Below you can find basic flow directions for updating PSC addresses, and also a path for updating new PSC subscriptions.
Update addresses
-
Create an address for the user using https://docs.piano.io/api?endpoint=post~2F~2Fpublisher~2Fuser~2Faddress~2Fcreate
-
The list of country and region IDs is here: https://docs.piano.io/faq-article/how-to-create-an-address-for-a-user-via-api/
-
They can also be pulled via the /anon/country/list/country endpoint.
-
-
Assign the address to the subscription using https://docs.piano.io/api?endpoint=post~2F~2Fpublisher~2Fsubscription~2Faddress~2Fassign
-
Both subscription ID and user address ID will be returned with the above calls, and we'd recommend storing them on your side.
-
If you need to look a user up by email address and then find their subscriptions and addresses, you can start by getting their UID from https://docs.piano.io/api?endpoint=post~2F~2Fpublisher~2Fuser~2Flist
-
The subscription ID is needed, and you can get it through https://docs.piano.io/api?endpoint=get~2F~2Fpublisher~2Fsubscription~2Flist
-
The user address ID for this call can be taken from an API call as well: https://docs.piano.io/api?endpoint=get~2F~2Fpublisher~2Fuser~2Faddress~2Flist
-
Get a list of new PSC subscribers for a given day
Our recommendation for pulling new subscribers for a given day is that you generate a report. This will allow you to pull the precise data that you need without having to sort through additional entries. In order to do so, you'll need to make use of the report creation and download process described here: https://docs.piano.io/api?chapterIntroId=chapter_17602
-
You can request a subscription log export for a particular time period and term ID: https://docs.piano.io/api?endpoint=post~2F~2Fexport~2Fschedule~2Fvx~2FsubscriptionLog
-
You can provide the term IDs for the relevant terms to simplify this process.
-
You can use the
start_date_fromandstart_date_toparameters to limit your search to a given timeframe.
-
-
Then you can check the report status with this endpoint: https://docs.piano.io/api?endpoint=get~2F~2Fexport~2Fstatus
-
Once the report is ready for downloading, you can get the URL to download it with this endpoint: https://docs.piano.io/api?endpoint=get~2F~2Fexport~2Fdownload~2Furl
-
The report will be in CSV format as described here: https://docs.piano.io/subscription-log-report/
-
From that report, you can obtain the UID and subscription ID for the update process.