addPostback

Adds a postback rule to be triggered by certain Leanplum message or A/B test events. The maximum number of postbacks allowed is three per app. This method requires your data export API clientKey.

See type and channels below for all possible events that can trigger postbacks. To see what values can be returned by the resulting POST request, see postbackUrl with an example template below.

Postback retry policy: If your app is unresponsive, Leanplum's request will timeout in 30 seconds. If the error code is 5xx, we will retry up to 9 more times with exponential backoff, starting from 1 hour, up to 10 hours. If all 10 times fail, the data is lost.

Body Params

The request body.

string
required
Defaults to YOUR_APP_ID

The application ID. To find yours, select your app in the navigation column, and click Manage Apps. Then click Keys & Settings.

string
required
Defaults to YOUR_DATA_EXPORT_KEY

The Data Export key for your Leanplum App.

string
enum
required
Defaults to 1.0.6

The version of the Leanplum API to use. The current version is 1.0.6.

Allowed:
string
enum
required
Defaults to messageEvents

The type of postback to add. There are currently two types.

  • messageEvents - Postback triggered by message events. See channels below for a list of all the message events that trigger postbacks.
  • abTestEvents - Postback triggered by the AB test impression/enter event.
Allowed:
channels
array

The messaging channels that will trigger postbacks — possible values include Push Notification, Email, and In-app Message. For example, this ...&channels=[Push Notification, In-app Message]... would activate postbacks for push and in-app message events only. If no channels are set, all three channels will trigger postbacks by default.

See below for a list of all the events that will trigger postbacks (by channel).

  • Push Notification — Sent, Open, Held Back
  • Email — Sent, Deferred, Delivered, Bounce, Open, Click, Marked as spam, Dropped, Unsubscribe, Held Back
  • In-app Message (events by template):
    • All templates — View, held back.
    • Center Popup, Confirm, Interstitial — Accept
    • Rich interstitial — Select Button 1, Select Button 2
    • Satisfaction Survey — Submit
    • Banner — Select Note that you cannot specify which specific events trigger postbacks, however, you can ignore certain events on your end if you prefer.
channels
string
required

The URL template to post after the trigger event occurs. This should go to the endpoint you are trying to send the postback data to. The template uses the same curly brace format as templated values on the dashboard. You can include any of the values below in your URL template, depending on what info you are interested in.

Possible values for all postback events

  • User ID — The user ID that triggered the postback.
  • Device ID — The device ID that triggered the postback.
  • Trigger time — The time in milliseconds at which the postback was triggered. The time can be a time in the past if the triggering event occurred in the past.

Possible message event values

  • Message ID — The message ID that triggered the postback.
  • Message event — The message event that triggered the postback (e.g. Send, Open).
  • Message channel — The channel of the message (push, email, or in-app message).
  • Template name — The template name of the in-app message. 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.

Possible A/B test event values

  • AB test ID — The ID of the A/B test the user entered into.
  • Variant ID — The ID of the variant group the user was sorted into.

See below for an example URL template with all possible values.

Response

Language
Credentials
URL
Response
Choose an example:
application/json