All API requests must be authenticated using a bearer token. The token must be included in the Authorization header of your request.
Example Header:
Authorization: Bearer <YOUR_TOKEN>
https://testshapi.assemble.co.tz
To obtain a bearer token, you need to make a POST request to the https://testshapi.assemble.co.tz/v1/connect/token endpoint with a Content-Type of application/x-www-form-urlencoded.
POST https://testshapi.assemble.co.tz/v1/connect/tokenRequest Body:
| Parameter | Type | Required | Description |
|---|---|---|---|
client_id |
string | Yes | Your client ID. |
client_secret |
string | Yes | Your client secret. |
grant_type |
string | Yes | Must be password or client_credentials. |
scope |
string | Yes | The scope of the access request. |
username |
string | No |
Example Request:
{
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"grant_type": "client_credentials",
"scope": "*",
"username": "hmis_username"
}
Example Response:
{
"success": true,
"statusCode": 200,
"message": [
"Token generated successfully"
],
"data": {
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "..."
}
}