New Beta Feature: Programmatic Delivery

Programmatic Delivery is a new beta feature that allows you to use our API to send broadcast messages to all or some of your users programmatically. It's perfect for breaking news or a targeted promotion. 

How it works

The broadcast method of our API tracks a Global Event in Leanplum. Unlike normal events in the track call, this event is truly global: it applies to all of your users. The nice thing about this is that you can have your backend send Global Events whenever you want, even every day (maybe after you have pushed all your segments to Leanplum), but if you have no campaigns on the dashboard actively listening for the Global Event, nothing will happen. 

However, if a campaign is listening for this Global Event, the campaign will then be triggered and sent to the users targeted by the message. This allows you to set-and-forget your Global Events and use the Leanplum dashboard to choose which Events to listen to.

For example, if you frequently send out campaigns on Thursdays, your backend can send a Global Event called "ThursdaySyncReady". But if you want to skip a particular Thursday, you don't need to modify your backend, you just go into the Leanplum dashboard, and edit the campaign to stop listening for that Global Event.

Note: We limit the number of broadcast calls to 1000 per day. This is the number of times you can send a Global Event per day, not the number of messages that result from it.

Setting up a message

It's pretty easy to setup a broadcast message.

  1. Create a message in the Leanplum Composer as you normally would.
  2. Set the delivery to triggered.
  3. Select Global Event Occurs as the Trigger.
  4. Enter the name of the event (in my case it is myGlobalBroadcastEvent).
    broadcast.png
  5. Start the message.

Making the API call

Arguments

name type description
appId string The application ID. To find yours, click your name in the dashboard, select App Settings, and click Keys & Settings next to your app.
clientKey string For this method, it is your Broadcast key (should begin with "brd_").
action string The api action (method). In this case, broadcast.
globalEvent string The name of your Global Event.
params object An object of parameters as key-value pairs.

Examples

GET 
https://www.leanplum.com/api?appId=APP_ID&clientKey=YOUR_BROADCAST_KEY&action=broadcast&globalEvent=YourGlobalEvent&params={"name1": "value1", "name2", "value2"}
POST
https://www.leanplum.com/api?action=broadcast

{
  "appId": "APP_ID",
  "clientKey": "YOUR_BROADCAST_KEY",
  "apiVersion": "1.0.6",
  "params": {
    "name1": "value1",
    "name2": "value2
  }
}

*Note: Programmatic Delivery was formerly known as Broadcast Push and Global Events.


Was this article helpful?
Have more questions? Submit a request