Webhooks
A webhook is a method for automatically transmitting data to your application via HTTP. Since webhooks are event-driven, they activate when specific events occur, such as message.received, message.status.updated, call.added, or ussd-pull.status.updated. They help automate processes within your application by responding to these events. For instance, in an e-commerce app, if you want customers to receive order status updates via SMS, you can set up a webhook for the message.received event. This webhook can respond to customers when their message contains a valid order ID. Such use cases are ideal for webhooks.
You can add webhook by going to Webhooks page from navigation menu. Just click on Add to add a new webhook.
Fields
URL
URL of the script where you want to receive the data from webhook. It will send a post request to this URL.
Secret
This is an optional field but recommend. This can be used to authenticate that the request is indeed coming from the webhook. It will add a header called Signature that will contain a signature the receiving app can use to verify if the payload hasn't been tampered with. You can verify the signature as shown below.
Events
Select events you want to subscribe too. There are four options as shown below.
call.added: Triggers when a new call was added to call log on any of the SIMs connected to the account.
message.received: Triggers when a new message is received on any of the SIMs connected to the account.
message.status.updated: Triggers when a message status changes.
ussd-pull.status.updated: Triggers when a USSD pull status changes.
Payload
You will receive post request on your URL when your subscribed events are triggered. The example payload for each event is shown below.