API get accounts
From Wiki
Contents |
GET accounts
With the API authenticating on user-level, you don’t have to integrate the API authentication for each individual account you have. You can use “GET accounts” to pull an up-to-date list of accounts and automatically do your needed requests for every account you have.
Please note: if you add or remove your user account to or from a publisher or advertiser account, it may take up to 10 minutes until this change in access rights takes effect in the API.
Who can use it
Every user that has at least one publisher or advertiser account. Please note: to use one of the other endpoints/methods to retrieve account data, you need to at least have "viewer" access to the account.
How to call it
https://api.awin.com/accounts (lists all accounts)
https://api.awin.com/accounts?type=publisher (only lists publisher accounts)
https://api.awin.com/accounts?type=advertiser (only lists advertiser accounts)
Add the parameter 'accessToken' to provide your access key as described in API authentication and authorization.
How does the response look
{ "userId": 699645, "accounts": [ { "accountId": 45628, "accountName": "Example Publisher", "accountType": "publisher", "userRole": "userAdmin" }, { "accountId": 57697, "accountName": "Demo Company Ltd.", "accountType": "publisher", "userRole": "userAdmin" }, { "accountId": 1001, "accountName": "Example Advertiser", "accountType": "advertiser", "userRole": "userOwner" }, (…)
Which data fields do we provide
field name | description |
accountId | ID of the account, as known from the frontend URLs (e.g. https://ui.awin.com/awin/affiliate/45628) |
accountName | programme name for an advertiser and company name for a publisher |
accountType | can be either publisher or advertiser |
userRole | the role your user account has for the account
|