Home Documentation Services FAQ Contact details
Sign in

Webhook notifications

The system can send event notifications (incoming messages, status of sent messages). To send notifications to external systems, the HTTP address must be configured in your account. The procedure for receiving notifications on the side of the external system is not defined. This should be taken into account when processing events based on the timestamp in the timestamp field.

Request format

{ 
    "messages":
        [
            {
                "body": "hello",
                "chatId": "11111111111@c.us",
                "formattedTitle": "Alex",
                "fromMe": false,
                "sender": "91111111111@c.us",
                "timestamp": "1537470363",
                "type": "chat",
            },
            ...
        ],

    "ask":
        [
            {
                "status": "1",
                "chatId": "11111111111@c.us",
            },
            ...
        ]
}
Parameter Value
Parameters nested in messages
body If the parameter value type— chat, the message text is displayed, otherwise a link to download the file is displayed.
chatId Individual chat ID
formattedTitle Sender name
fromMe Possible values:

  • true — outgoing message.

  • false — incoming message.
sender Message author ID
timestamp UNIX timestamp in seconds
type Message type.

Possible values:

  • document — document.

  • video — video.

  • image — image.

  • ptt — voice message.

  • audio — audio recording.

  • chat — text message.
Parameters nested in ask
status The status of the sent message.

Possible values:

  • 1 — sent to.

  • 2 — delivered.

  • 3 — read.
The status is transmitted for the last sent message in this chat.
chatId Individual chat ID

Response format

The server must tell the system it has received the information with the HTTP code 200 OK

Attention

If, upon request, the robot receives a response code other than 200 OK, The system will repeat the requests to the server with the intervals equal to 5 min. / 10 min. / 15 min. / 30 min. / 1 hour / 3 hours / 6 hours / 9 hours / 18 hours.

If no response has been received after having nine attempts 200 OK, webhook is removed.