Generating Access Token
After generating your API keys, you would need to generate an Access Token. This token will authenticate your requests and allow you to access our services.
POST /oauth/token
Description
The /oauth/token endpoint serves to provide an authorization token which can be used to access the rest of Comms360 services. Once the request is successfully processed, you will receive a response that includes your access token and additional details about your account.
Required Body Paramaters
-
client_id: Your API encrypted client id string. For example, AIzaSyDaGmWKa4JsXZ-HjGw7ISLn_3namBGewQe -
client_secret: Your API encrypted client secret string. For example, AIzaSyDaGmWKa4JsXZ-HjGw7ISLn_3namBGewQe
- Example Request
- Example Response
curl -X POST https://service-prod.api.comms360.africa/api/oauth/token \
-H "Content-Type: application/json" \
-d '{
"client_id": "XXXXXX",
"client_secret": "XXXXXX"
}'
HTTP/1.1 200 OK
Content-Type: application/json
{
"responsecode": 200,
"data": {
"business": {
"id": "xxxxxx-xx-xxx-xxxx-xxxxxxxx",
"name": "New-Account",
"creator": "name",
"status": "Active",
"created_at": "2025-01-01T00:00:00.000000Z",
"updated_at": "2025-01-01T00:00:00.000000Z"
},
"access_token": "XXXXXX",
"token_type": "Bearer",
"scopes": [
"sms"
],
"expires_at": "2025-01-01 00:00:00"
},
"responsemessage": "Client authenticated."
}
Use the Access Token for API Requests
Now that you have your access token, you can use it to authenticate your API requests. Simply include the token in the Authorization header of your requests like so:
curl -X GET https://service-prod.api.comms360.africa/api/some-endpoint \
-H "Authorization: Bearer <your_access_token>"