API Keys
To use the third-party WhatsApp integration APIs, you must request and use an API key. This key will be used to authenticate your requests.
Requesting an API Key
To request a new API key, send a POST request to /api/api-keys/request.
Endpoint
POST /api/api-keys/request
Request Body
{
"clientName": "Your Application Name",
"email": "developer@yourcompany.com",
"scopes": ["send:free-text", "send:template", "send:image"]
}Example
curl -X POST {{baseUrl}}/api/api-keys/request \
-H "Content-Type: application/json" \
-d '{
"clientName": "Your Application Name",
"email": "developer@yourcompany.com",
"scopes": ["send:free-text", "send:template", "send:image"]
}'clientName: The name of your client application.email: The email address where notifications about the API key status will be sent.scopes: An array of scopes your application needs. Common scopes includesend:free-text,send:template, andsend:image.
Response
You will receive the newly generated API key in the response. Keep this key secure. The key status will initially be pending. It must be approved by an administrator before it can be used.
Key Status and Notifications
The API key goes through various statuses. You will receive email notifications at the address provided during the request when the status changes.
- Pending: The initial status after requesting a key. The key cannot be used yet.
- Approved: An administrator has approved your request. You will receive an email stating your key has been approved. The key is now active and ready for use.
- Rejected: Your request was rejected by an administrator. You will receive an email with the rejection reason.
- Revoked: An active key can be revoked by an administrator if necessary. You will receive an email notifying you of the revocation. The key can no longer be used.
Environments
We currently provide two environments for our API. Please replace {{baseUrl}} in the examples with the appropriate URL for your needs:
- Development:
https://api.dev.dash.amili.asia - Production:
https://api.dash.amili.asia
Authentication
Once your API key is approved, you must include it in the x-api-key header of all subsequent API requests.
Example Request
curl -X POST {{baseUrl}}/third-party/messages/send-text \
-H "x-api-key: ak_test_xxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"phone": "+1234567890", "text": "Hello, world!"}'