Skip to content

Setting Up a Webhook

Overview

A webhook allows real-time data transfer between web applications. Cellcast provides you with two types of WebHooks for integrating your application. Follow these steps to set up a webhook with Receive URL and Status URL. Both MO (Mobile Originated) and DLR (Delivery Report) can be forwarded to user webhook.


Webhook Configuration

From your dashboard, click to the top right of the page, and there is an API menu in the dropdown.

profile

After that, you go to the API KEYS tab.

webhook

Scroll down to Webhook section to start setting up your webhook

webhook

1. Receiver Setup

  • Receive URL: Specify the URL where your server will receive webhook payloads. On this URL you will receive any responses submitted by your users.
    • Example: https://yourdomain.com/webhook-receiver

webhook

  • Test Send: You can test the receive webhook by providing the payload and sending the request.

webhook

Example Data From Receive Webhook

json
{
    "_id": "66b5b93b1e2c012dfe964000",
    "status": "delivered",
    "type": "receive",
    "message": "This is reply message",
    "sender": "+61400000000",
    "receiver": "+61400000001"
}
FieldDescription
_idmessage Id
statuscurrent status of message i.e. "delivered", "received", "expired", "dead", "rejected", "failed"
typetype of request e.g. "receive"
messageresponse from your customer
sendersender phone number
receiverreceiver phone number

2. Status Setup

  • Status URL: Specify the URL to verify and monitor webhook status. On this URL you will receive status of messages sent via Cellcast's API.
    • Example: https://yourdomain.com/webhook-status

webhook

  • Test Send: You can test the status webhook by providing the payload and sending the request.

webhook

Example Data From Status Webhook

json
{
    "_id": "66b5b93b1e2c012dfe964000",
    "status": "delivered",
    "type": "send",
    "sender": "cellcast",
    "receiver": "+61400000001"
}
FieldDescription
_idmessage Id
statuscurrent status of message i.e. "delivered", "received", "expired", "dead", "rejected", "failed"
typetype of request e.g. "receive"
sendersender phone number
receiverreceiver phone number

Message Status

The following are the status codes returned in DLRs that our message gateway supports.

StatusDescription
deliveredMessage has been delivered by the carrier transport
receivedMessage has been received
rejectedThe carrier rejected the message
expiredThe carrier was unable to deliver the message in a specified amount of time. For instance when the phone was turned off.
failedMessage delivery status has failed
deadMessage has been deleted

Webhook Security

Cellcast webhooks support authentication through Basic Auth. To enhance security, you can configure the Username and Password for your webhooks. When a webhook is triggered, the request header will include an authorization field like "Authorization": "Basic dGVzdEF1dGhVc2VybmFtZU000000000000000000000000000000". This field contains a Base64-encoded string that combines the username and password, which the receiving server can decode to authenticate the request.

webhook-security