WebHooks Guide
The WebHooks service allows you to keep the status of the contacts in your lists synchronized with your CRM, avoiding the need to constantly invoke the API in search of news about the removal and/or bounce of contacts.
A WebHook is a simple user-defined callback in the form of an HTTP POST in JSON format, which is invoked when something new occurs regarding your contact list. For example, when someone unsubscribes, you might want that update to be available on your system immediately, or within a few hours. This is feasible by defining a URL to which the information must be sent when the requested event occurs.
Using the example of an unsubscription, the following details the information that can be obtained in the body of the request.
The format of the sent body is kept uniform for all existing event types, simply modifying the content.
In order to minimize the number of HTTP POSTs that are made to your defined URL, it can be configured so that we send the summary of updates of the requested event (removals or bounces) daily. In this way, the body of the request will detail a list of contacts with their changes.
There are currently two types of events that can be configured through the WebHooks service:
• Description
• Bounces
The fields of the request body format are detailed below.
Action: Type of Event (Unsubscribe/Bounce)
Reason: Reason for unsubscription or bounce.
Date: Date of the event.
Email: Updated contact.
Status: Current status of the contact in the system (U: Unsubscribed, R: Bounced)
Below are examples of the request body for each of the actions.
What is a WebHook?
A WebHook is a simple user-defined callback in the form of an HTTP POST in JSON format, which is invoked when something new occurs regarding your contact list. For example, when someone unsubscribes, you might want that update to be available on your system immediately, or within a few hours. This is feasible by defining a URL to which the information must be sent when the requested event occurs.
Using the example of an unsubscription, the following details the information that can be obtained in the body of the request.
{"Actions":[
{"Action":"Unsubscribe"
,"Reason":"Unsubscribe Request"
,"Date":"20140116 17:41:47"
,"Email":email@domain.com
,"Status":"U"}
]
}
The format of the sent body is kept uniform for all existing event types, simply modifying the content.
Batch Events?
In order to minimize the number of HTTP POSTs that are made to your defined URL, it can be configured so that we send the summary of updates of the requested event (removals or bounces) daily. In this way, the body of the request will detail a list of contacts with their changes.
{"Actions":[
{"Action":"Unsubscribe"
,"Reason":"Unsubscribe Request"
,"Date":"20140116 17:41:47"
,"Email":email@domain.com
,"Status":"U"},
{"Action":"Bounce"
,"Reason":"Inexistent"
,"Date":"20140116 17:41:47"
,"Email":email2@domain.com
,"Status":"R"}
]
}
Available WebHooks
There are currently two types of events that can be configured through the WebHooks service:
• Description
• Bounces
The fields of the request body format are detailed below.
Actions: List of events to process
Action: Type of Event (Unsubscribe/Bounce)
Reason: Reason for unsubscription or bounce.
Date: Date of the event.
Email: Updated contact.
Status: Current status of the contact in the system (U: Unsubscribed, R: Bounced)
Below are examples of the request body for each of the actions.
Description
{"Actions":[
{"Action":"Unsubscribe"
,"Reason":"Unsubscribe Request"
,"Date":"20140116 17:41:47"
,"Email":email@domain.com
,"Status":"U"}
]
}
Bounces
{"Actions":[
{"Action":"Bounce"
,"Reason":"Inexistent"
,"Date":"20140116 17:41:47"
,"Email":email2@domain.com
,"Status":"R"}
]
}
Updated on: 05/31/2023
Thank you!