1. Home
  2. Docs
  3. Getting started
  4. Receive a valid Access_Token

Receive a valid Access_Token

During the sign-up & subscription, the Bizao team will provide you:

  • a Client_ID :
    • Sample:
      zrYcdShzZgVRszIchOaEcU904sa
  • a Client_Secret :
    • Sample:
      zqxYcdrtzZgVRipzIc2sEcgHpmdA
  • a valid BearerACCESS_TOKEN of one year duration

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

Step 01 – Generate basic token

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) = 
  “TjJ4ZTd4emsyNUZaRW5TMFlnbWxEMTBhOnhwUERza0JJOUdLcGJQamtISnJBTjZRYQ==” 


Below a screenshot 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 02 –  Make a request to the endpoint /token

Sample request :

Curl -X 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": "YOUR_ACCESS_TOKEN",
"scope": "am_application_scope default",
"token_type": "Bearer",
"expires_in": 31536000
}

Note:

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

Was this article helpful to you? Yes No

How can we help?