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.
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.
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.
- Use the campaign-specific Push API key to send calls to the single user Push API or to a group of users via the Swrve Batch Push API. For more information, see the Swrve Push API Guide or Swrve Batch Push API Guide.
- View results or reports for your single user Push API campaign or change the status. For more information, see Managing Push Notifications.