API address
For both A2 On-Premise and A2 Cloud, use the API address provided for your deployment. In the examples, replaceyour_a2_service with that domain.
Response
Authentication by API
Whether you need an access token depends on what the API is for.
The APIs for ad and recommendation requests and event and activity log delivery don’t need an access token, so you can call them directly from a web page or app. Call the Data Management API from your server, with your access token in the
Authorization: Bearer <token> header.
Issue an access token
Issue the access token in Ad Manager with an admin account.1
Sign in to Ad Manager
Sign in to Ad Manager with an admin account.
2
Go to Development Settings
Open Management > Settings and go to the Development Settings section.
3
Issue or copy the token
If Access Token is empty, click the refresh icon to issue one. If a token already exists, click the copy icon to copy it. Clicking the refresh icon makes the existing token unusable, so be careful.
Get a login token for testing
Get a login token for testing
You can also get a login token with an account’s email and password. A login token acts with that account’s permissions and expires after 8 hours. Use it for testing or one-off tasks.The
access_token value in the response is the login token. It is different from the access token issued in Development Settings.Response
Call an API with your token
Replace<token> with your token and read your account information to check that authentication works.
Response (excerpt)
401. If the account doesn’t have permission to call the API, you get 403.
Regenerate the token
You don’t need to manage an expiration date for the access token, and there is only one per system. If it leaks or needs replacing, regenerate it on the Ad Manager Development Settings screen. The access token acts with the permissions of the admin account that issued it. If that account is deactivated or deleted, requests with the token fail, and changing the account’s role or permissions can block some APIs. Before you remove the account or change its permissions, regenerate the token with another admin account and update your integrated systems. You can also regenerate it through the API. The new token is inaccess_token.access_token in the response.
