Use case:
Often there is a need to test a triggered campaign after it's creation. Using Leanplum's API library in Postman, you can speed up your testing and eliminate the need to manually trigger campaigns from your Leanplum enabled app.
This method is best used on campaigns that involve server-side actions (Push, Email or Webhook). Any client-side messages will need to be viewed by opening the app (In-app, App Inbox, App function).
Steps:
- Setup Postman
- Create your triggered campaign in the Leanplum dashboard.
*Optional: Set the same custom event/state for Trigger and Goal. This way the user will exit and immediately re-enter the campaign on each event occurrence, for faster testing. - In Postman, open the Track API call from the collection (documentation for Track).
- Populate your test user ID and event/state name. The rest of the fields will pull data from your environment variables form step 2.
- Send the API call. The campaign should trigger and your user should receive the campaign actions. Repeat to exit and immediately re-enter the user in the campaign, repeating all campaign actions.
Manual method without using Postman:
- Create your campaign
- Optionally give it the same trigger and goal event. This way you can trigger it repeatedly, as the user will exit and immediately re-enter it on each trigger.
- Get the API keys for your Leanplum app
- Use the following API call, replacing the values in bold. Paste it in your browser's URL:
https://api.leanplum.com/api?action=track&apiVersion=1.0.6&appKey=YOUR_APP_KEY&clientKey=YOUR_PROD_KEYuserId=YOUR_USER_ID&event=YOUR_EVENT