When configuring a webhook, you must specify what data will be sent to your system. Before configuring anything, it is recommended to understand what you can send and determine your data needs. This guide will help you understand the code that is sent in response to the events.
***The info in this article can be different from your project depending on the structure you have.***
Webhook Format
All notifications are sent in JSON format. These notifications always start with an identifying parameter, as those in the table below, and the fields from the project's primary key as well.
Parameter | Description |
---|---|
Type | contains a chain of characters that represents the type of notification sent. This parameter can have such values as:
This list is not exhaustive. |
EventUniqueID | contains a chain of characters that uniquely identifies the notification. |
dtExecution | for the exact date and time the notification was sent. |
idCompany | contains the company’s ID. |
idProject | contains the ID of the project where the notification is configured. |
isTest | is present and contains ”true” if this is a test notification sent from the webhook configuration interface, and is not present when a real notification is sent. Note that the system must accept the isTest parameter as follows: if this parameter is “true”, you must not try to deactivate a real contact or edit a profile upon reception of a test message. |
ContactID | contains a dictionary of values that identifies the contact in Dialog Insight (“idContact”). |
Contact Triggers
- "OptinField" contains the code of the opt-in field.
- "OptinDate" contains the date the contact subscribed.
- "OptinField" contains the code of the opt-in field.
- "OptinDate" contains the date the contact unsubscribed.
- "idSendLog" contains the ID of the mailing that conducted to the quarantine.
- "idMessage" contains the ID of the message used for the mailing.
- "dtProcessed" contains the date and time the mailing entered production.
- "dtBounce" contains the date and time the message return the quarantine error.
- "dtDelivered" contains the date and time the message was delivered.
- "dsnMTA" contains the domain name of the MX server where the exchange occurred.
- "dsnDiag" contains the error code sent by the server, which has cause the quarantine.
Emails/SMS/Push Triggers
Error notifications for messages contain the parameters included in all system notifications, as well as the information on the error (shown in the «SendLog” dictionary):
- "EventType" contains one of the two possible mailing types in error:
- "Batch" for batch mailings or campaigns.
- "Event" for single message mailings (confirmations, Web Services, tests).
- "idSendLog" contains the ID of the mailing in error.
- "idMessage" contains the ID of the message used for the mailing.
- "idMessageCategory” contains the ID of the communication type used for the message.
- "dtProcessed" contains the date and time the mailing started to be sent.
Notifications for delivery errors inform you when a delivery error occurs, including when a contact is quarantined. These notifications contain common parameters such as identifiers, as well as information on the mailing and on the error (shown in the ”DeliveryErrorInfo” dictionary):
- "dsnMTA” contains the domain name of the MX server where the exchange occurred.
- "dsnDiag" contains the error code sent from the server, and which caused the quarantine.
- "BounceCode" contains the SMTP error code.
- "isInvalidMailbox" indicates whether the email address is invalid or not.
- "BounceType" contains the type of error.
This type of notification allows you to be informed when an error occurs when the message is being prepared, before it is even sent. These notifications contain common parameters, as well as information on the mailing and on the production error (shown in the “ProductionErrorInfo” dictionary).
System Error Examples | ||
---|---|---|
ErrorCode | Error | ErrorMessage |
0 | NoError | No Error |
1 | RecipientEmailSyntax | Recipient email syntax is invalid. |
2 | Compilation | There was a compilation error in the message. |
3 | Execution | There was an execution error in the message. |
4 | SenderEmailSyntax | Sender email syntax is invalid. |
5 | Submission | An unknown internal error occurred. |
6 | RequiredDataMissing | An unknown internal error occurred. |
7 | EligibilityError | The contact was not eligible to receive the message. |
99 | Undocumented | An unknown internal error occurred |