Swrve’s Transactional Push API enables you to send a push notification to a single user 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.
Create a Transactional Push API Campaign
To create a transactional push API campaign and access the 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 Transactional 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 service like https://www.hurl.it/ (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.
Viewing Transactional 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.