Authorization
The Sovrn Advertising Reporting API requires an Authorization header to be added to each request, ensuring that we keep our data secure.
There are currently no limitations on how many API keys can be created on your account; however, any one of the generated keys will grant you access to all Advertising reporting data associated with your Sovrn account.
Managing API Keys on your Account
To create/manage your API key(s)
- Log into the Sovrn Platform
- Navigate to API Keys, found in the Account menu
- Select the “+ API Key” button located in the top right corner
- Enter a name for the new API key, then select “Create”
- The newly generated API key will now be displayed, ensure you save the key before closing the window as this will be the only time you will be able to view the value
- API key entries can be deleted at any time by selecting the trashcan icon located on the right side of the entry
Note: You must be the account owner to create or delete API keys. To determine the email address of the current account owner, visit Manage users in the Sovrn Platform and locate the “original user.” If you need to change the account owner, please contact support.
How to Provide the API Key to Pass Authentication
The API Key is provided as part of the request header, as a key/value pair. The header name is “x-api-key” and the value is the API Key that the publisher has generated in the platform. For example:
x-api-key: {API KEY}
The API Key will be a 7-character sequence followed by a ‘.’ and then a 32-character UUID. For example:
1234567.a34d7eb0-abfc-44fea-9fcc-7es42be45663
Please ensure that the word “x-api-key” is included as text, plus a space, before passing the value of your APIKey.
Example Request
Below is an example CURL request that you can run to verify everything is working correctly:
curl --request GET \ --url
'https://api.sovrn.com/reporting/advertising/publishers/262681/domains/sovrntest.com/account?start=2021-08-01T00%3A00%3A00Z&end=2021-09-02T00%3A00%3A00Z&metrics=publisherRevenue&dimensions=domain%2CzoneId'
\ --header 'x-api-key: prefix1.XXXXXXXX-YYYY-ZZZZ-AAAA-BBBBBBBBBBBB'