API authentication – new vs. legacy method
As of Q3 2024, Equativ provides two API authentication methods:
- the new authentication method using the OAuth protocol:
- is released in Q3 2024 and made available to customers’ networks progressively
- to be used for all new API users
- for this authentication method, you can create API accounts autonomously, retrieving the credentials directly in Equativ’s Monetization Platform – read the “API users” section in the User management article for detailed instructions
- the legacy authentication method using Basic Authentication
- enters its deprecation phase in early 2025
- deprecation expected to be finalized by July 15, 2025; make sure you create new OAuth API users and remove BasicAuth API users
- for this authentication method, API accounts are created by Equativ’s service teams – reach out to your contact at Equativ to receive your credentials
New API authentication method using OAuth
Step 1 – Create API user
To be able to authenticate, you must first create an API user in order to obtain the
clientId and
clientSecret. The API user setup is explained in section "API users" in
User management.
Step 2 – Request the access token from Equativ’s identity provider
Using the
clientId and
clientSecret obtained in Step 1, first request the access token from Equativ’s identity provider:
curl --request POST \
--url https://login.eqtv.io/oauth2/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id={clientId} \
--data client_secret={clientSecret}
In the response, you will receive the access token, which has a time to live of 600s (10min):
{
"access_token":"<access token>",
"expires_in": 600,
"token_type": "Bearer"
}
Step 3 – Use the user token in API requests
Use the user token obtained in Step 1 in the Authorization header of all your API requests:
curl --request GET \
--url https://supply-api.eqtv.io/sites \
--header 'Authorization: Bearer <access-token>'
Legacy API authentication method using Basic Authentication
To be able to authenticate using Equativ’s legacy API authentication method (using Basic Authentication), first reach out to your contact at Equativ to receive your credentials:
- the API login in format userName@networkName
- the password
To authenticate, add the following headers to your API requests:
Authorization: Basic YYY
Content-Type: application/json; charset=utf-8
YYY is the base64-encoded concatenation of your API login and your password, separated by a colon (“:”): userName@networkName:password
The following sample shows the headers to be added to API requests with the base-64 encoded credentials:
Authorization: Basic bXlVc2VyTmFtZUBteUNvbXBhbnlOYW1lOm15UGFzc3dvcmQ=
Content-Type: application/json; charset=utf-8