Get_Token - Tranglo

Get_Token

Retrieves a JSON Web Token (JWT) for authenticating requests to the Tranglo Business.
Requires a valid Client ID and Client Secret Key obtained from the Tranglo Business system.
Returned token must be included in the Authorization header (Bearer <token>) for all subsequent API calls.
Token Expiry: Tokens are valid for a limited duration (5 mins). After expiry, Sales Partners must call Get_Token again with valid credentials to obtain a new token.

Definition

POST: <<URL>>/token
Content-Type: application/x-www-form-urlencoded

Sample Request

{
"grant_type": "client_credentials",
"Client_ID": "0342D234255-O234-9675-1231-P23123@132-12312",
"Client_Secret": "dmUYGg2YG3IQcmROFvohyfd9HzCLzqVg"
}

Request Description

Field TypeRequiredDescription
Grant_typeAlphanumericMandatorySpecifies the type of authorization being requested.
Note: In this case, it is "client_credentials", indicating the use of an API granted to a partner for accessing data.
ClientIDAlphanumericMandatoryUnique Client ID assigned to Corporate Customer.
Secret_KeyAlphanumericMandatoryUnique Client Secret Key assigned to Corporate Customer.

Sample Response

HTTP Status: 200 OK
Response Body:
{
"Access_token": "<jwt-token>",
"Expires_in": "3600",
"Token_Type": "Bearer",
"Scope": "partnerapi"
}

Response Description

ParameterData TypeRequiredDescription
Access_tokenAlphanumericMandatoryUnique JWT token generated, which client can use for subsequent API calls.
Expires_inNumericMandatoryLifetime in seconds of the access token. Example, "3600" (1 hour).
Token_TypeAlphanumericMandatoryType of token, which is typically "Bearer".
ScopeAlphanumericMandatoryDefines the permissions or access level granted by the token, specifying which resources or actions the client can access.

M = Mandatory, C = Conditional, O = Optional