Get Access Token
Get Access Token
Section titled “Get Access Token”Access to the Trust2Connect API is secured via the OAuth 2.0 Client Credentials flow. Before making any requests to protected API resources, your application must obtain a valid access token. This token serves as proof of authentication and authorization.
Request Type
Section titled “Request Type”POST
Access Token Retrieval
Section titled “Access Token Retrieval”To obtain an access token, send a POST request to the following authorization endpoint:
Request URL
Section titled “Request URL” POST
https://api.trust2connect.ai/api/v1/token Basic Authorization Credentials
Section titled “Basic Authorization Credentials”HTTP Basic Authorization requires encoding your credentials (username and password) and including them in the Authorization header of your HTTP request. For our token endpoint, your client_id acts as the username and your client_secret acts as the password.
| Parameter | Type | Required | Description |
|---|---|---|---|
client_id - username | string | Yes | The unique identifier assigned to your business unit (application) upon registration with Trust2Connect. This acts as your public key for authentication. Provided upon approval of API access |
client_secret - password | string | Yes | The confidential secret key associated with your client_id. Must be kept secure and never exposed in client-side code (e.g., in a browser). Provided upon approval of API access |
Request Body
Section titled “Request Body”The request to the token endpoint must include the following parameter in the body, sent as application/x-www-form-urlencoded content type:
| Parameter | Type | Required | Description |
|---|---|---|---|
| grant_type | text | Yes | Specifies the OAuth 2.0 grant type. For the Client Credentials flow, this must be set to client_credentials |
Token Generation Example
Section titled “Token Generation Example”Example Request
Section titled “Example Request”curl --location 'https://api.trust2connect.ai/api/v1/token' \--data-urlencode 'grant_type=client_credentials'Example Response
Section titled “Example Response”{ "access_token": "gq5mWQ4InJUXJG2yDPyApPZ5CDvt", "expires_in": 1799, "token_type": "Bearer", "client_id": "w37zIFSO4dZhhb7ZlveQ7ZGVHRGZTwTx6Z0M8Alzg7ttInpf"}