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:

  1. Create a POST request to the following endpoint:

    https://{{INSTANCE}}/api/auth/token/
  2. In the HTTP request body, include the username and password parameters, and then, include your respective values of these parameters.

  3. In the HTTP request header, include the parameter Content-Type with value application/x-www-form-urlencoded.

  4. 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
}