Skip to main content
8x8 Support

How to generate an API access token

Objective

How to generate an API Access Token to be used as the Bearer Token with 8x8 APIs

Applies To

  • Call recordings & Storage / Cloud Storage Service Public API

Procedure

8x8 provides a client credentials pair consisting of both a key and secret. You can then request an access token from the 8x8 Authorization Server using Basic Authorization with your key and secret as the username and password, respectively.

The encoded string is used in the Authorization header of the access token POST call you make to the 8x8 Authorization server. The response from this call contains the desired access token.

The access token enables secure access to APIs that are available within your organization’s scope. Note that the access token is valid for a limited time (30 minutes). Once the access token has expired, you have to make a new access token request.

  1. Obtain an API key and secret from 8x8 Admin Console, For more details please see Generate an API key in 8x8 Admin Console                       Admin Console API Keys.png
  2. Combine and then encode your client credentials as a Base64 string
    • For the example Base64 enoded exampleKey:exampleSecret is ZXhhbXBsZUtleTpleGFtcGxlU2VjcmV0
    • This can be done with Postman or an online conversion tool
  3. Make a POST request to the 8x8 Authorization Server https://api.8x8.com/oauth/v2/token using your encoded credentials string in the Authorization header

Example Request

curl --request POST \
  --url https://api.8x8.com/oauth/v2/token \
  --header 'Authorization: Basic ZXhhbXBsZUtleTpleGFtcGxlU2VjcmV0\
  --header 'Content-type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials 
  1. Obtain your access token from the response body

Example 200 OK Response Body

{
    "refresh_token_expires_in": "0",
    "api_product_list": "[storage]",
    "api_product_list_json": [
        "storage"
    ],
    "organization_name": "8x8gateway",
    "token_type": "BearerToken",
    "issued_at": "1640998861000",
    "client_id": "**********",
    "access_token": "**********",
    "application_name": "**********",
    "scope": "",
    "expires_in": "3599",
    "refresh_count": "0",
    "status": "approved"
}

Additional Information

Postman Example

  1. Select the POST Method
  2. Enter the URL https://api.8x8.com/oauth/v2/token
  3. Enter the key and secret from 8x8 Admin Console as the username and password respectively

Postman BasicAuth1.png

  1. Note on the Headers Tab Postman has encoded this in Base64 for the Authorization Header

Postman BasicAuth2.png

  1. Click Send
  2. Obtain your access token from the response body
  • Was this article helpful?