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

NameTypeDescription
dataobject
Contains message information.
Data Object
NameTypeDescription
idstring
Unique identifier of your message.
request_idstring
Unique identifier of request generated by you to trace requests.
Default: NULL
channelstring
The communication channel your message sent through.
Possible values: SMS and WHATSAPP
statusstring
Initial status of your message.
Possible values: PENDING, FAILED, DELIVERED, SEEN
typestring
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