Authentication Flow - For Advertisers/Agencies

Fetch JWT Token

Endpoint

POST /v1/oauth2/authenticate

Headers:

Authorization: Basic {base64_encoded_username:password}

Note: Viant will provide the username and password for API access.

Response (Success):

{
  "access_token":"eyJraWQiOiJ...",
  "expires_in":86400,
  "id_token":"eyJraWQiOiJN...",
  "refresh_token":"eyJjdHkiOiJKV1Q..",
  "token_type":"Bearer"
}

Response (Failure):

{
  "error_description" : "error message",
  "error": "error code"
}

Refresh Access Token

Use this endpoint to refresh your access token using the refresh token provided during authentication.

Endpoint: POST /v1/oauth2/token

Headers:

Authorization: Basic {base64_encoded_username:password} X-Auth-Type: user

Request Body:

Content-Type: application/json

Request Payload:
{
  "grant_type": "refresh_token",
  "refresh_token" : "eyJjdHkiOiJKV1Q..."
}
Content-Type: application/x-www-form-urlencoded

Request Payload:
grant_type=refresh_token&refresh_token=eyJjdHkiOiJKV1Q...

Response (Success):

{ 
  "access_token" : "eyJraWQiOiJLVk....",
  "expires_in" : 86400,
  "id_token" : "eyJraWQiOi....",
  "token_type" : "Bearer"
}

Response (Failure):

{
  "error_description" : "error message",
  "error": "error code"
}