Table of Contents

Generating Access Token

You are here:
< All API Documentations

1. Main credentials

At subscription the Bizao team will provide you :

  • a CLIENT_ID

Sample : “zrYcdShzZgVRszIchOaEcU904sa”

  • a CLIENT_SECRET

Sample: “zqxYcdrtzZgVRipzIc2sEcgHpmdA”

  • a valid Bearer ACCESS_TOKEN of one year duration :

The CLIENT_ID and CLIENT_SECRET are used only to generate your ACCESS_TOKEN.

2. Generate your access_token

You can also generate your ACCESS-TOKEN by following these 2 steps :

  • STEP 1 :

Generate a basic token based on your CLIENT_ID and your CLIENT_SECRET
encoded in base64. See the sample below:

  • CLIENT_ID =
“N2xe7xzk25FZEnS0YgmlD10a”
  • CLIENT_SECRET =
“xpPDskBI9GKpbPjkHJrAN6Qa”
  • YOUR_BASIC_AUTHORIZATION base64(CLIENT_ID:CLIENT_SECRET) =
“TjJ4ZTd4emsyNUZaRW5TMFlnbWxEMTBhOnhwUERza0JJOUdLcGJQamtISnJBTjZRY Q==”

Below a screen shot of how to encode a string in base64 format on
https://www.base64encode.org/

Below a sample of how to generate YOUR_BASIC_AUTHORIZATION using PHP :

$id = "N2xe7xzk25FZEnS0YgmlD10a";
$secret = "xpPDskBI9GKpbPjkHJrAN6Qa";
$yourBasicAuthorization = base64_encode("$id:$secret");
  • STEP 2 :

Make a request to the endpoint https://api.bizao.com/token

Request sample :

curl --location --request POST \ 'https://api.bizao.com/token' \
-H 'authorization: Basic TjJ4ZTd4emsyNUZaRW5TMFlnbWxEMTBhOnhwUERza0JJOUdLcGJQamtISnJBTjZRYQ==' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials' \

Success query response :

"access_token": “4xx1bae4-3f9b-346-9w1b-c0e4d4ef”,
"scope": "am_application_scope default",
"token_type": "Bearer",
"expires_in": 31536000

As long as your ACCESS_TOKEN is valid, this request will give you the same token with the
remaining time in seconds before expiration (see expires_in parameter).

After the expiration date, this request will regenerate a new ACCESS_TOKEN.