Swrve’s streamlined campaign workflow now supports creating push notification campaigns that are triggered via API. Use the newly redesigned message builder to include predefined content or include custom content when sending the API call from your external system. For information about configuring your request to the Push API, see the Swrve push API guide.
Creating a push API campaign
The first steps for creating a push via API campaign are similar to creating a standard push campaign.
To set up your campaign
- To create a new campaign from your Campaigns center, select Create campaign.
- On the Choose your marketing channel screen, select the Push campaign channel.
- Under Choose Notification type, select Push via API as the push type.
- Under Choose platform, Any is selected by default. If your app supports multiple platforms, the campaign will be sent to qualifying users regardless of their platform. If you need to create a platform-specific campaign, select the individual platform.
- To continue to the Campaign overview screen, select Continue.
- Enter the Campaign name and Description, then select Save to go to the campaign builder.
The blocks on the campaign screen guide you through building your campaign, but you can complete them in any order.
There are two main differences between the blocks available for a standard push campaign and push via API. Since push via API campaigns are triggered externally, there is no need to specify the Audience or Schedule. Push via API campaigns have an additional API block where you can test the content you want to send via API call.
For general information about each section, see the following:
Default campaign content
If you want to include default content for your push API campaign, on the Content block, select edit . Adding content is optional—if the API call includes custom parameters, it overwrites the default content. For more information about custom parameters, see the Push API guide.
The options available for adding your notification content are the same as standard push, except you cannot personalize, localize, or test multiple variants of a push API campaign. For information on adding notification content, see Adding your notification content.
Testing the campaign
To preview your message on a physical device, first ensure your device is set up on the QA Devices screen.
- On the Content screen or API block, select Test.
- In the Send test message window, select your device from the list.
- The window displays sample cURL and HTTP POST commands with the campaign-specific API key and your user ID.
Select Copy to clipboard and edit the test message as required.
- To send the test message to the device, run the cURL command in the terminal or copy the HTTP POST command to a REST client service like Insomnia or Postman (remembering to use POST, not GET).
Starting the campaign
If you’re happy with your test message and are ready to make the campaign active, on the Campaign builder, select Activate campaign.
Once the campaign is active, use the campaign-specific Push API Key and URL displayed on the API block to trigger push notifications to individual users, either via webhooks from a third-party system 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.
- Set custom goals to measure the success of your campaign. For more information, see Campaign goals.
- If you’re using the push API with your marketing cloud campaigns, review how to configure the linked push notification campaign in Journey Builder or Responsys.
- View results and reports for your campaign or change the status. For more information, see Managing your campaigns.