Postback improvements
almost 6 years ago by Eleni Misthos
4/30/2018 — We’ve updated our postbacks feature to add support for two additional message channels. Starting today, postbacks can now be triggered on all message events for push notifications, in-app messages, and emails.
Here’s what you need to know about the changes:
- We no longer accept the type
pushNotificationEvents
, the only valid type will bemessageEvents
. Existing postbacks using thepushNotificationEvents
type will continue to be supported. - You can now specify which messaging channels send postbacks using the
channel
parameter (optional) with addPostback. Choices arePush Notification
,Email
andIn-app Message
channels.
There are three new parameter options for your postback URL template:
channel
: The channel of the message (push, in-app, or email).template_name
: The name of the in-app message template (returns an empty string for non-in-app messages).parameters
: All the parameters associated with the event when it is triggered. For example, an email’s Click event will include the URL clicked and the index of the URL. parameters are in JSON format, and all parameter values are URL encoded.
Here’s an example template URL that includes all the available values:
https://api.service.com/v1/example?message_id={{Message ID}}&event={{Message event}}&device_id={{Device ID}}&user_id={{User ID}}&time={{Trigger time}}&channel={{Message channel}}&template_name={{Template name}}¶meters={{Parameters}}
See our addPostback API documentation for the full details on our postbacks feature.