Authentication

Beta uses the OAuth2 client-credentials grant type to authenticate access to secure resources.

When sending your requests, you must include an OAuth 2 bearer authentication Access token in your request's Authorization HTTP header field of your request.

Authentication diagram

Request Access Token

Get a new access token

POST https://live.betaapp.com/v1/auth/token

Use this endpoint to obtain an access token. After a successful request, save the token, as you might need it to communicate with our API in the future.

Headers

Name
Type
Description

Content-type*

String

application/json

accept*

String

application/json

Request Body

Name
Type
Description

client_id*

String

The ID provided by Beta

client_secret*

String

Your secret

The response will return a new access token, a Refresh token and the number of remaining seconds that the token is valid for.

{
"access_token": "ghjdfknrgkdFGHJBKnlefwkbjvbfmsdfdvsjhdbGCFGHJBK",
"expires_in": 86400,
"token_type": "Bearer",
"refresh_token": "dg4yu53mvyui24nmvdyui248934m245m65o3245657676gdkd",
}

Request Example:

curl -X 'POST' \
  'https://live.betaapp.com/v1/auth/token' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "client_id": "7DFGaTDiBailk...Lb7A",
  "client_secret": "mM398fj-A9Me9dlkszP...Myd3-eJWQ"
}'

Response Example:

{
"access_token":"Mn37fJgGciOiJSm3Isd7kjFnR5cCI6IsdFFkbCIsImtp..."
"expiration":86400
}

When calling our APIs, you must include the word "Bearer" before you include the token value.

Revoke Token

Revoke token

POST https://live.betaapp.com/v1/auth/revoke

This endpoint is used to revoke an access token from our cache. By revoking the token you can request a new one with the '/auth/token' endpoint

Headers

Name
Type
Description

Content-Type*

String

application/json

accept*

String

application/json

Request Body

Name
Type
Description

client_id*

String

The ID provided by Beta

client_secret*

String

Your secret

  {
   "status": "Success",
  }

If you send an expired Token to Beta, you will receive a 401 error, your integration must stop using this token and must request a new token to avoid receiving additional 401 errors.

Request Example:

curl -X 'POST' \
  'https://live.betaapp.com/v1/auth/revoke' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "client_id": "7DFGaTDiBailk...Lb7A",
  "client_secret": "mM398fj-A9Me9dlkszP...Myd3-eJWQ"
}

Response Example:

{
"status": "Success"
}

Last updated