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 | Type | Required | Description |
| Grant_type | Alphanumeric | Mandatory | Specifies 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. |
| ClientID | Alphanumeric | Mandatory | Unique Client ID assigned to Corporate Customer. |
| Secret_Key | Alphanumeric | Mandatory | Unique 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
| Parameter | Data Type | Required | Description |
| Access_token | Alphanumeric | Mandatory | Unique JWT token generated, which client can use for subsequent API calls. |
| Expires_in | Numeric | Mandatory | Lifetime in seconds of the access token. Example, "3600" (1 hour). |
| Token_Type | Alphanumeric | Mandatory | Type of token, which is typically "Bearer". |
| Scope | Alphanumeric | Mandatory | Defines the permissions or access level granted by the token, specifying which resources or actions the client can access. |
M = Mandatory, C = Conditional, O = Optional