Postback improvements

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 be messageEvents. Existing postbacks using the pushNotificationEvents type will continue to be supported.
  • You can now specify which messaging channels send postbacks using the channel parameter (optional) with addPostback. Choices are Push Notification, Email and In-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}}&parameters={{Parameters}}

See our addPostback API documentation for the full details on our postbacks feature.