Authorizing Management API
This article documents how to obtain an authorization token for the Adverity Management API.
Procedure
To obtain an authorization token for the Adverity Management API, follow these steps:
-
Create a POST request to the following endpoint:
https://{{INSTANCE}}/api/auth/token/
-
In the HTTP request body, include the
username
andpassword
parameters, and then, include your respective values of these parameters. -
In the HTTP request header, include the parameter
Content-Type
with valueapplication/x-www-form-urlencoded
. -
Send the request.
As a result, you obtain your API token for the Management API in the response. All other API calls made through Management API require this API token in the request header (parameter Authorization
with value Token 123
).
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location --request POST 'https://{{INSTANCE}}/api/auth/token/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'username={{USERNAME}}' \
--data-urlencode 'password={{PASSWORD}}'
Example of JSON response:
{
"username": "your.username@example.com",
"token": "123",
"expires_in": null
}