6 Message structure
6.1 General
- Timestamps are given in UTC timezone. The format is "YYYY-MM-DD'T'HH:MM:SS'Z'". (Example: 2021-03-29T07:56:32Z )
6.2 Top level structure
Message data is sent as a JSON structure. At top-level, the JSON is
{
"event_count": <number of events>,
"event_type": <type of event>,
"events": [
<N-times the basic message format>
]
}
- event_count contains the number of events listed in events property.
- event_type indicates the type of events listed in events property.
- events lists the event data, with same event type for all list items.
6.3 Basic event structure
Each event contains of a set of properties:
{
"event_id" : <unique numeric value to identify event>,
"event_timestamp" : <timestamp of event in UTC>,
"event_data" : <event-specific data>
}
- event_id is a unique numeric value. This can help to identify event data, that has already been processed.
- event_timestamp shows, when the event occured. This is not the timetamp, when the notification was sent.
- event_data contains the event-specific data.
6.4 Examples
Here are some examples to show complete JSON structures.
6.4.1 mailing_opened (one event)
This example shows the data for the mailing_opened event containing data for one event:
{
"event_count": 1,
"event_type": "mailing_opened",
"events": [
{
"event_id": 12345678,
"event_timestamp": "2021-02-18T13:06:45Z",
"event_data": {
"mailing_id": 123456,
"recipient_id": 4567,
"recipient_data": {
"some_profile_field": "value1",
"other_profile_field": "123"
}
}
}
]
}
6.4.2 mailing_opened (multiple events)
This example shows the data for the mailing_opened event containing data for multiple events:
{
"event_count": 3,
"event_type": "mailing_opened",
"events": [
{
"event_id": 12345678,
"event_timestamp": "2021-02-18T13:06:45Z",
"event_data": {
"mailing_id": 123456,
"recipient_id": 4567,
"recipient_data": {
"some_profile_field": "value1",
"other_profile_field": "123"
}
}
},
{
"event_id": 12345689,
"event_timestamp": "2021-02-18T13:06:47Z",
"event_data": {
"mailing_id": 123462,
"recipient_id": "not_tracked",
"recipient_data": {}
}
},
{
"event_id": 12345722,
"event_timestamp": "2021-02-18T13:07:02Z",
"event_data": {
"mailing_id": 123210,
"recipient_id": 3245,
"recipient_data": {
"some_profile_field": "value2",
"other_profile_field": "456"
}
}
}
]
}
The recipient in the second event data has rejected to be tracked. recipient_id shows "not_tracked" and the profile field data is empty.
6.4.3 link_clicked
This example shows the data for the link_clicked event containing data for one event:
{
"event_count": 1,
"event_type": "link_clicked",
"events": [
{
"event_id": 12345690,
"event_timestamp": "2021-02-18T13:08:21Z",
"event_data": {
"mailing_id": 123459,
"recipient_id": 5678,
"recipient_data": {
"some_profile_field": "value1",
"other_profile_field": "123"
},
"link_id": 23456789012
}
}
]
}