Содержание

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 enKodSettingsto 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

{
  "event": "message sent",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Sending message (test)",
  "from": "[email protected]",
  "to": "[email protected]"
}

Where.

Delivery error

{
  "event": "delivery bounce",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Error while sending message (test)",
  "from": "[email protected]",
  "to": "[email protected]",
  "error_message": "Some error message"
}

where

Opening message

{
  "event": "message open",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Open message (test)",
  "from": "[email protected]",
  "to": "[email protected]"
}

where

Click in message

{
  "event": "message clicked",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Click in message (test)",
  "from": "[email protected]",
  "to": "[email protected]",
  "click_url": "https://clicked.link/"
}

where

Complaint

{
  "event": "сomplaint",
  "message_id": 4,
  "message_uid": "0123456789_012_012_01234",
  "sending_type": "instant",
  "name": "Complaint in message (test)",
  "from": "[email protected]",
  "to": "[email protected]"
}

where

Subscription to a mailing group

{
  "event": "mailing group subscribe",
  "email": "[email protected]",
  "group_id": 4,
  "group_name": "Person subscribe (test)",
  "channel": "email"
}

where

Unsubscribe from mailing group

{
  "event": "mailing group unsubscribe",
  "email": "[email protected]",
  "group_id": 4,
  "group_name": "Person unsubscribe (test)",
  "channel": "email"
}

where

Adding a contact

{
  "event": "contact adding",
  "email": "[email protected]",
  "phone": "80123456789",
  "groups_names": [
    "test_group_0",
    "test_group_1"
  ],
  "groups_ids": [
    0,
    1
  ]
}

where