Содержание

Webhooks

Webhooks are a way to notify you of an event that has occurred on the system using custom callbacks over HTTP.

Configure the webhook in the SettingsWebhooks to receive event notifications to your URL.

You can specify a separate URL for each event or a common one for all events. Before saving, you should test the requests by clicking on the corresponding button. We will send test data to the specified URL, so you can see the structure and we will check the availability of the link. If the testing is successful, the webhook can be saved.

POST requests for events are currently available:

The body is fixed and looks as follows:

Message sent (Email)

{
  "event": "message sent",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Sending message (test)",
  "from": "user@gmail.com",
  "to": "destination@gmail.com"
}

where:

Delivery bounce (Email)

{
  "event": "delivery bounce",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Error while sending message (test)",
  "from": "user@gmail.com",
  "to": "destination@gmail.com",
  "error_message": "Some error message"
}

where:

Opening a message (Email)

{
  "event": "message open",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Open message (test)",
  "from": "user@gmail.com",
  "to": "destination@gmail.com"
}

where:

Click in the message (Email)

{
  "event": "message clicked",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Click in message (test)",
  "from": "user@gmail.com",
  "to": "user2@gmail.com",
  "click_url": "https://clicked.link/"
}

where

Complaint (Email)

{
  "event": "сomplaint",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Complaint in message (test)",
  "from": "user@gmail.com",
  "to": "destination@gmail.com"
}

where

Template message sent (WhatsApp)

{
  "event": "whatsapp template sent",
  "template_name": "template_example",
  "message_id": 123,
  "sending_type": "scenario",
  "from_number": "70000000000",
  "to_number": "71111111111"
}

where:

Template message delivered (WhatsApp)

{
  "event": "whatsapp template delivered",
  "template_name": "template_example",
  "message_id": 123,
  "sending_type": "scenario",
  "from_number": "70000000000",
  "to_number": "71111111111"
}

where:

Template message read (WhatsApp)

{
  "event": "whatsapp template delivered",
  "template_name": "template_example",
  "message_id": 123,
  "sending_type": "scenario",
  "from_number": "70000000000",
  "to_number": "71111111111"
}

where:

Incoming message received (WhatsApp)

{
   "event": "whatsapp inbox message received",
   "message": "some text",
   "from_number": "71111111111",
   "to_number": "70000000000"
}

where:

Template message delivery bounce (WhatsApp)

{
   "event": "whatsapp template bounce",
   "template_name": "template_example",
   "message_id": 123,
   "sending_type": "scenario",
   "from_number": "70000000000",
   "to_number": "71111111111",
   "error_message": "Some error message"
}

where:

Subscription to a mailing group (Email)

{
  "event": "mailing group subscribe",
  "email": "user@gmail.com",
  "group_id": 4,
  "group_name": "Person subscribe (test)",
  "channel": "email"
}

where:

Unsubscribe from mailing group (Email)

{
  "event": "mailing group unsubscribe",
  "email": "user@gmail.com",
  "group_id": 4,
  "group_name": "Person unsubscribe (test)",
  "channel": "email"
}

where:

Adding a contact

{
  "event": "contact adding",
  "email": "user@gmail.com",
  "phone": "80123456789",
  "groups_names": [
    "test_group_0",
    "test_group_1"
  ],
  "groups_ids": [
    0,
    1
  ]
}

where: