post https://api4.optimove.net/General/RegisterEventListener
Specifies the URL of a listener to which Optimove will report events of the specified type (e.g., "campaign scheduled").
Notes
- This function does not return a payload. A successful call will return a response code of 200 (success). Refer to an explanation of the other possible response codes at Function Error Response Codes.
- Valid values for EventTypeID are:
- 1 = A campaign has been processed for execution. Will be sent when the execution of at least one of the channels/templates is successful.
- 2 = All today's campaigns have been processed for execution (even if some failed).
- 3 = Today's entire daily process has been completed.
- 4 = A campaign that had been processed for execution was canceled.
- 5 = A scheduled campaign with conditional promo/bonus system activation has been processed for execution but is on hold until the ClearanceRequiredBy date/time supplied to the listener at the time of event notification, and then will only be sent to customers for whom the promotion was activated in the promo/bonus system (learn more here).
Please Note:- EventTypeID = 5 cannot be registered for a specific channel. Rather, it should be registered as a general listener (without specifying a specific channel ID).
- EventTypeID = 5 is relevant for scheduled campaigns with conditional execution. To implement conditional execution with Triggered campaigns, please follow the article 'Setting Up Conditional Execution'.
- 11 = A user has met a trigger criteria set up for a real-time campaign (Note: This event type is only relevant for Optimove clients using Track & Trigger).
- 13 = A campaign has been processed for execution in a particular channel (but not necessarily via any additional channels included in the same campaign). Will be sent when ALL templates for the specific channel are sent successfully. Note: If a ChannelID is specified when registering this type of listener, a notification will be sent each time a campaign has been executed via the specified channel. If no ChannelID is specified, a notification will be sent when execution has been completed for each channel for every campaign.
- ChannelID is optional for users with full permissions. Users with limited permissions (i.e. per specific channel) must include ChannelID for all types of events. Available ChannelID values can be seen here.
- The specified ListenerURL to call when the webhook should be notified.
- Each EventTypeID must be registered separately (via a separate call), even if the listener URL is identical for more than one EventTypeID.
- Once a listener has been registered, Optimove will call the listener with an HTTP POST request in JSON format, and expects to receive a response of success (200). The structure of the request depends on the EventTypeID:
{
"EventTypeID":1,
"TimeStamp":"YYYY-MM-DD HH:MM:SS",
"CampaignID":x
}
{
"EventTypeID":2,
"TimeStamp":"YYYY-MM-DD HH:MM:SS"
}
{
"EventTypeID":3,
"TimeStamp":"YYYY-MM-DD HH:MM:SS",
"UpdateDate":"YYYY-MM-DD"
}
{
"EventTypeID":4,
"TimeStamp":"YYYY-MM-DD HH:MM:SS",
"CampaignID":x
}
{
"EventTypeID":5,
"TimeStamp":"YYYY-MM-DD HH:MM:SS",
"CampaignID":x,
"CampaignDuration":y,
"ClearanceRequiredBy":"YYYY-MM-DD HH:MM:SS"
}
Note: ClearanceRequiredBy is calculated by Optimove based on the campaign's selected execution channel(s).
{
"sendId": "string",
"customerID": "string",
"isVisitor": boolean,
"actionID": int,
"promoCode": [],
"channelID": int,
"campaignID": "string",
"templateName": "string",
"campaignSeriesID": "string",
"templateID": int,
"timestamp": epoch timestamp seconds,
"personalization": {
"personalInfo": {
"tagName": "val"
},
"eventName": {
"eventParam": "val"
}
},
"actionName": "string",
"triggerName": "string",
"targetGroupName": "string",
"brandID": "string",
"tags": [],
"notes": "string"
}
//Note:
//Personalization values will only be included if defined in the campaign: personalInfo may be one more personalization fields defined in the Optimove database (personalInfo is available for any channel using personalization tags); eventName may be one or more defined events that are part of the campaign's trigger.
//In order to receive this event for customers that are allocated to the campaign’s control group, ChannelID 100 must be included in the registration request.
//ExternalData will be supplied only for Optimove’s integration partners for whom it was considers as part of the integration scope
{
"EventTypeID":13,
"TimeStamp":"YYYY-MM-DD HH:MM:SS",
"CampaignID":x,
"ChannelID":x
}
- For all event types we offer authentication method using Authorization Header
The values for the header are in the following format: key1=value1;key2=value2;key3=value3. - For configuration, please contact your CSM.
Sample Request
{
"EventTypeID":1,
"ChannelID":505,
"ListenerURL":"http://www.exampleurl.com/eventlistener6"
}
Sample Response (none)