Skip to main content

Create Token

To integrate authorization using a Bearer token for API authentication, you can generate a token using the Create Token API.


📡 API Endpoint

POST https://intelsend.com/api/v1/auth/token


📝 Request Headers

NameValueDescription
AuthorizationBasic client-id:client-secretAuthorization credentials, where client-id and client-secret are provided.
Content-Typeapplication/jsonIndicates that the request body is in JSON format.

📦 Request Body

NameTypeRequiredExample ValueDescription
grant_typeString✅ Yesclient_credentialsMust be set to client_credentials.
valid_hourInteger❌ No24Token validity in hours. Default: 24 (1 day). Max: 168 (1 week).

Example Request

curl --location 'https://intelsend.com/api/v1/auth/token' \
--header 'Authorization: Basic client-id:client-secret' \
--header 'Content-Type: application/json' \
--data '{ "grant_type": "client_credentials", "valid_hour": 24 }'

📥 Response Body

NameTypeExample ValueDescription
access_tokenStringabc.....123The token used for subsequent API calls.
valid_tillDatetime2024-11-12 10:00:00Expiration datetime of the token (UTC).

Example Response

{
"access_token": "abc.....123",
"valid_till": "2024-11-12 10:00:00"
}

🚀 Usage in API Calls

Include the generated access_token as a Bearer token in the Authorization header of all subsequent API requests.

curl --location 'https://intelsend.com/api/v1/your-endpoint' \
--header 'Authorization: Bearer abc.....123' \
--header 'Content-Type: application/json'

📝 Notes

Best Practices
  • Keep your client-id and client-secret secure.
  • Always use the access_token within its validity period (valid_till).
  • If the token expires, call the same API to generate a new one.