Security
When setting up webhook endpoints, you can secure your application against unwanted requests by configuring webhook secret. Each request signature is created using the HMAC_SHA256 hashing algorithm. The algorithm signs the webhook payload with the secret you have provided. The resulting hash is included in the request’s signature header in the following format:
X-TopMessage-Signature: {TOPMESSAGE_HMAC_SIGNATURE}
Manage your webhook endpoints
here
Use Case Examples
The following are some examples of use cases for the TopMessage API:
Full Request Parameters
Name | Type | Description |
---|---|---|
data | object | Contains message information. |
Data Object
Name | Type | Description |
---|---|---|
id | string | Unique identifier of your message. |
request_id | string | Unique identifier of request generated by you to trace requests. Default: NULL |
channel | string | The communication channel your message sent through. Possible values: SMS and WHATSAPP |
status | string | Initial status of your message. Possible values: PENDING , FAILED , DELIVERED , SEEN |
type | string | Type of event related to the message. |
POST
https://{your_domain}/your_webhook/path
X-Topmessage-Signature: {TOPMESSAGE_HMAC_SIGNATURE}
Content-Type: application/json
Request Sample
Payload
Java
Python
PHP
Node.js
C#
{
"data": {
"id": "b04fc4d3-f232-46b7-b66b-538c0d4b3404",
"request_id": "b04fc4d3-f232-46b7-b66b-538c0d4b3404",
"channel": "SMS",
"status": "DELIVERED",
"type": "STATUS"
}
}
Response Sample
200 OK