Set up webhooks to promptly receive data from us when any events occur, for example, when receiving delivery statuses or an incoming Viber message. You don't need to constantly request these data via the API.
You can enable webhooks in the "Webhooks" section, where you can configure a webhook for the required event.
When adding a webhook, you need to specify the callback URL where we will send the data, select the required events that will trigger the webhook, enter a security secret key to prevent request forgery, add a login and password for HTTP Basic authentication (if needed), and choose the data format. Currently, the JSON and FORM DATA formats are supported, sent via the POST method.
The following data will be sent with each webhook:
- id the unique identifier of the event that occurred;
- signature the SHA1 hash of a string consisting of the security secret key and id;
- type the event type;
- date the date and time when the event occurred;
- try the sequential number of the attempt to send data in case previous attempts were unsuccessful;
- data an array or object (depending on the chosen data format) containing the event data;
When sending a request to the callback URL, your server must return an HTTP status code of 200, indicating that the request was processed successfully. All other codes will be interpreted by our service as failed requests, so we will attempt to resend it. Resend attempts will occur after 1 minute, then after 3 minutes, then after 5, 10, 15, 20, 30, 60, and 120 minutes. In other words, we will try to deliver your webhook data for 4.5 hours in total, after which further resend attempts will stop. You can also manually trigger a webhook resend in the user panel.
Supported event types:
The following is a description of the data structures that will be sent in the data parameter depending on the event type.
Receiving the delivery status of an SMS sent via HTTP API
Usually, error codes conform to the SMPP specification, but there can be exceptions when an operator has its own set of error codes. In such a case, we may additionally request the meaning of a specific code. If you are interested in the reason for a message rejection, please contact us and we will send a clarifying request to the operator.
Description of the status field values
Receiving the delivery status of an SMS sent via SQL
Getting the Delivery Status of SMS Sent via SOAP
Getting the Delivery Status of SMS Sent via SMPP
Getting the Delivery Status of Viber Sent via HTTP API
Getting the Delivery Status of Viber Session Messages
Receiving Incoming Viber Messages
Please note that this event can only be generated for messages with click tracking (click-through statistics) enabled.