Last modified January 22, 2015 by Shelly Wolfe

Transactional Push API Campaigns

Swrve’s single Push and Batch Push APIs enable you to send a push notification to a single user or a group of users that is triggered by an external event from a third-party system. You can configure the notification to include predefined content or create a custom message by triggering an external call to the Push API. For more information about configuring your request to the Push API, see the Swrve Push API Guide and the Swrve Batch Push API.

This article covers how to create push notification campaigns that are triggered externally using the Push API or Batch Push API. The initial steps are very similar to creating a single push notification or recurring push notification campaign that is launched or scheduled directly in Swrve. For more details on the initial steps, see Creating Push Notifications.

Create a Push API campaign

To create a push API campaign and get the campaign-specific Push API key:

Step 1: On the Campaigns menu, click Push Notifications.

Step 2: On the Push Notifications screen, click Transactional Push via API.

Step 3: On the Overview screen, enter the notification Name, Description and Platform, and then click Next: Default Content.

If your app supports multiple platforms, you can now send a single transactional push notification to multiple platforms by selecting All Platforms from the Platform list.

Step 4: On the Default Content screen, add the default content of your push notification (for example, text, emoji, media, buttons, alert sound, custom parameters), if required. This step is optional — if the API call includes custom parameters, it overwrites the default content. Click Next: Campaign Goals to proceed.

Step 5: On the Campaign Goals screen, specify the campaign goals and then click Save as Draft: Preview & Test.

Step 6: The Preview & Test screen displays your Push API Key, the Push API URL, and a summary of the campaign. To QA test the Push API campaign:

  • Click the Select a QA Device to test with list and select the QA device to which you want to send the test message.
  • After you select a QA device, the screen displays sample curl and HTTP POST commands relevant to this campaign and the selected QA device. Run the curl command in the terminal to send a test message to the device. Alternatively, copy the HTTP POST command to a REST client service like Insomnia or Postman (remembering to use POST, not GET). You can edit the message content as required.

Step 7: If the QA test is successful, to start the campaign, click Make Active.

After you make the campaign active, you can use the Push API key and URL to trigger push notifications to individual users from a third-party system. This may be via webhooks in another marketing package (for example, Marketo) or using your own custom code. For more information on the API call method, URL parameter, expected responses and possible error codes, see the Swrve Push API guide and Swrve Batch Push API guide.

Viewing Push API results

To view details and results for a particular campaign, click the push notification summary on the Push Notifications screen. For campaigns in any status other than Draft, the individual campaign screen displays a detailed report of your campaign results. The results reflect any users who engage with the push notifications triggered via the Push API key associated with this campaign. For more information on the individual campaign screen, see Managing Push Notifications.

Next steps