This reference article covers how to generate a
campaign_idto include in your API calls and how to configure that campaign.
API campaigns are typically used for transactional messaging. When creating API campaigns (not API-triggered campaigns), the Braze dashboard is only used to generate a
campaign_id, which lets you track analytics for campaign reporting. You can also generate a message variation ID, which is different for each variant in your campaign.
You’ll then send that information to your development team to use in the API request, along with:
- Campaign copy
- Audience membership
After the campaign begins, you can view the results in the dashboard. API campaigns use the Braze messaging APIs, which have the same detailed reporting and retargeting options as campaigns created completely through the dashboard.
Because API campaigns are typically transactional, all users are eligible for API campaigns, even those in your Global Control Group.
Create a new campaign
Go to Messaging > Campaigns and click Create Campaign, then select API Campaigns. Now, you can move on to configuring your API campaign.
An API-triggered campaign is different from an API campaign.
Configure your campaign
To configure your campaign, perform the following steps:
- Add a descriptive title so you can find the results on our campaigns page after you’ve sent your messages.
- Click Add Message and add the messages types which will be included in your API campaign. This will allow you to generate a
campaign_idand a message variation ID, which differs for each channel you include.
- Optionally, You can add a conversion event to track user conversions on a specific action or campaign goal.
- Click Save Campaign and you’re set to begin your API campaign!
After you save your API campaign include the following in your API request:
- The generated
campaign_idfields with your API request where noted in the Send Messages Endpoints.
- A message object for each platform included in the campaign. In the message object, provide the message variation ID. This will specify that statistics should be collected and displayed under that variant. The following message objects are supported: Android, Content Cards, email, iOS, Kindle, SMS/MMS, web push, and webhook.