Token Based Authentication

A secure authentication mechanism that allows API access using a generated Token.

circle-check

Generate Access Token for Authentication

This endpoint is used to generate an access token required for authenticating.

Endpoint

GET

Header
Type
Required
Description

client-id

string

Yes

Base64-encoded domain name

client-secret

string

Yes

Client secret key

circle-info

Note on Generating Access Token:

  1. The client-id remains the same for both Sandbox and Production environments.

  2. The client-secret differs between the Sandbox and Production accounts.

  3. Access tokens generated for the Sandbox environment are prefixed with "sandbox_".

  4. Access tokens generated for the Production environment are prefixed with "live_".

  5. Tokens for Sandbox and Production are distinct and cannot be used interchangeably.


Success Response - For Production

Success Response - For Sandbox


Response Body Parameters

success boolean

Indicates whether the token generation was successful (true or false).


data object

Contains the access token details.


token_type string

Type of token. Always Bearer.


token string

The actual access token to be used in the Authorization header.


expire_in string

Token expiry duration in seconds.


message string

Message indicating the result of the token generation request.


Validate Access Token for Authentication

This endpoint is used to generate an access token required for authenticating.

Endpoint

GET


Header

When making authenticated API calls, an Access Token must be provided using the Authorization header in the format below:

The <access_token> varies depending on whether you're working with the Production or Sandbox environment.

circle-info

Notes for Validating Access Token

  1. The app-id parameter is not required when validating an access token.

  2. The Authorization header must use the Bearer prefix (For example, Bearer <token>), not Basic.

  3. Access tokens are different for each environment (For example, sandbox and production).

  4. If the token is valid, the API will return a successful response.

  5. If the token is invalid or expired, the API will respond with an “Authorization Required” error.


1. Production Environment Token

  • Tokens prefixed with live_ are specific to the production environment.

  • These tokens are valid only for production API endpoints.

  • Example:


2. Sandbox Environment Token

  • Tokens prefixed with sandbox_ are specific to the sandbox/test environment.

  • These cannot be used with production endpoints.

  • Example:

Last updated

Was this helpful?