Campaign Example
The following is an example of the JSON data structure of an Campaign. Additional details about the individual attributes of Campaigns can be found below.Example Campaign
Campaign Attributes
nameCurrently read-only. The Campaign name, set by the advertiser.
advertiserIdRead-only. The advertiser associated with the Campaign.
goalThe marketing goal of the Campaign. Can be
Acquisition, Retention or Unspecified (only for older campaigns).
spendLimit.spendLimitRenewalThe cadence of spend limit renewal. Can be
daily, monthly, lifetime, or undefined in the case of an uncapped limit type.
spendLimit.spendLimitTypeWhether the Campaign spend is capped or not. Can be
capped or uncapped.
spendLimit.spendLimitAmountA decimal value representing the spend limit for the Campaign. If
spendLimitType is uncapped, the value will be null.
Create a campaign
A new campaign can be created for a specific advertiser by making a POST call to the campaigns endpoint. The request body should specify the type (Campaign) and the campaign attributes.
Spend Limit
spendLimitRenewal and spendLimitAmount are only relevant when spendLimitType is set to capped.GoalThe field
goal is mandatory and can be either Acquisition or Retention.Campaign) and the campaign attributes of the new campaign.
Searching Campaigns
Retrieving Campaigns by Filtering
Campaigns can be retrieved by specifying filters to apply to the set of all Campaigns in your portfolio. Using filters, you can restrict the returned results to particularadvertiserIds or specific campaignIds. Filters can be combined.
For example, to retrieve the Campaigns in your portfolio related to a particular advertiser, filter by advertiserIds:
Sample Response
Retrieving All Campaigns
When no filters are specified in the JSON payload, all Campaigns in your portfolio will be returned, as in the example below:Retrieving One Specific Campaign
You can also fetch the details for a single Campaign using a GET request: The responsedata will be a single object containing the Campaign details.
Sample Response
Update Campaigns
The fields of one or more Campaigns can be updated by making aPATCH call to the Campaigns endpoint. The payload should be an array of partial or whole Campaigns, each specifying the fields to be modified.
For example, the following call would update the spendLimit settings of an existing Campaign:
data. These will contain only two parameters, type and id.
Sample Response
Partial Success / Partial Failure
Each Campaign update is processed individually and can succeed or fail without impacting other updates in the same payload. As a result, those Campaign updates processed successfully will be returned in thedata array of the response, while Campaign updates that have failed will return as an entry in the errors array of the response.
For instance, for this payload which intends to update two Campaigns:
Sample Response
Error
instanceThe instance field for validation errors will specify the index of the related update, beginning with index 0. For the example above, @data/1 refers to the second requested update in the request’s data array.In addition to general API errors , you may encounter validation errors when updating a Campaign. Below is a list of error codes for Campaign validation and a more detailed description of their meaning.
Validation Errors and Warnings
Campaign Update Errors:campaign--campaign-update-check--spend-limit-does-not-existAn update to spend limit was attempted on a Campaign which does not have a spend limit (e.g. an uncapped Campaign). Alternatively, the requestor may not have permissions to update the spend limit of the Campaign.
campaign--campaign-update-check--cannot-decrease-lifetime-spend-limit-below-what-is-already-spentAn update attempted to decrease a lifetime spend limit of a Campaign to a value lower than what has already been spent.
campaign--campaign-update-check--validation-failed-on-spend-limitTK
campaign--campaign-update-check--cannot-update-same-campaign-multiple-timesThe Campaign is included multiple times in the same update payload. All Campaign field updates should be consolidated into one array item.
campaign--campaign-update-check--unavailable-feature-for-this-advertiserTK Campaign Update Warnings:
campaign--campaign-update-check--new-spend-limit-amount-will-take-place-at-the-next-period-startThe update to spend limit was processed, but it will not take effect until the next period specified by
spendLimitRenewal (e.g. the next day). This is typically because the new spend amount specified is lower than the amount already spent in the current period.