Leanplum's user guides and developer documentation.

Leanplum Documentation

Leanplum's user guides, SDK setup, API docs, and more resources are here to help you get the most out of A/B testing, Campaigns, Messaging, and Analytics.

Webhook basics

A webhook is a simple notification that is sent as an HTTPS POST request after something occurs. In Leanplum, a webhook is a type of message you can use to send real-time Leanplum user data to another server.

For example, you could send a webhook to confirm when a user reads a message. Or, you could send a webhook that triggers a third-party service to do something, like send an email, Slack someone, or store something in a database.

Create a webhook

To create a webhook in Campaigns, create a new campaign, or add a new action to an existing campaign and select Webhook as the action type.

To create a webhook in Messaging, create a new message and select Webhook as the message type.

Webhook config in Campaigns

Set and customize the URL. This is where Leanplum will send the webhook data. The URL can be common to all users in the audience (fixed), or it can include personalized information about each user, using user attributes and/or event parameters. For more, see Personalize a message.

Set the content type. The content type is an HTTP header setting used when sending the actual POST request. You can choose between application/json and application/x-www-form-urlencoded.

If the webhook is set to x-www-form-urlencoded, all the Data variables will be formatted using the x-www-form-urlencoded standard. For example, if the Data variables are set like:

first_name: Mary
last_name: Doe

Then the body will look like:

first_name=Mary&last_name=Doe

If the webhook is set to application/json, the body will look like:

{
  "first_name": "Mary",
  "last_name": "Doe"
}

🚧

Be sure to set this to the correct content type for the service or API you’re delivering the webhook to.

Send data with the webhook. You can send custom key-value pairs within the message that can be utilized by the server that receives the webhook. The values are set directly in Leanplum, and they can include personalized values. For more, see Message templating {{.

Authentication

Basic authentication can be used by appending the username and password to the url in the following format: https://username:[email protected] .

Updated 22 days ago


Webhook basics


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.