This API exposes operations to allow management of Campaigns and their Contracts within the Cxense Advertising platform.
This API can be accessed by users with the appropriate permissions to manage Campaigns and supports the following combination of operations on the Campaign and Contract domain objects:
|
Object |
Supported operations |
|---|---|
|
Campaign list |
GET |
|
Campaign |
POST, GET, PUT and DELETE |
|
Contract list |
GET |
|
Contract |
POST, GET and PUT |
Retrieving the list of Campaigns within a Folder
The GET operation is supported for listing existing Campaigns.
GET
Retrieve all of the Campaigns contained within the Folder with the given folderId.
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
folderId the id of the Folder for which the Campaigns are to be retrieved (can be determined as detailed in Folder REST API - GET operation)
Example commands:
|
Individual Campaigns
The POST, GET, PUT and DELETE operations are supported for management of individual Campaigns.
POST
In order to be able to create a Campaign the user must first decide in what location (or Folder) the Campaign is to be created.
A list of Folders at any given point in the tree of advertising accounts can be retrieved, starting from the top-level Advertising Folder and working down the tree. Please refer to Folder REST API for details on how to discover Folders in Cxense Advertising.
Perform a POST operation with the following URL to create a new Campaign under the Folder with the given folderId.
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
folderId the id of the Folder under which the new Campaign is to be created (can be determined as detailed in Folder REST API - GET operation)
This XML example shows the mandatory and optional contents required to be supplied for a POST call:
|
Example commands:
|
|
GET
Retrieve the Campaign with the given campaignId
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
campaignId the id of the Campaign to be retrieved
Example command:
|
This XML example shows the contents returned from a GET call for a campaign with no per user impression cap:
|
This XML example shows the contents returned from a GET call for a campaign with a per user impression cap:
|
PUT
Update the Campaign with the given campaignId
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
campaignId the id of the Campaign to be updated
Example command:
|
DELETE
Delete the Campaign with the given campaignId
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
campaignId the id of the Campaign to be deleted
Example command:
|
Retrieving the list of Contracts for a Campaign
The GET operation is supported for listing existing Contracts.
GET
Retrieve all of the Contracts for the Campaign with the given campaignId.
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
campaignId the id of the Campaign for which the Contracts are to be retrieved
Example command:
|
Individual Contracts
The POST, GET, PUT and DELETE operations are supported for management of individual Contracts.
POST
Create a new Contract under the Campaign with the given campaignId.
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
campaignId the id of the Campaign under which the new Contract is to be created
When a new Contract is created under a Campaign this is the equivalent of clicking the Publish button in the UI for the Campaign and hence results in the Campaign going LIVE. Therefore, equivalently, when POSTing a new Contract via this REST API the status field is defaulted to LIVE meaning any value supplied for this field in the request XML is ignored.
When creating a contract for a Tenancy product, the start and end date will be converted into the same time zone as that used for the product, so the dates may change if you use a different time zone.
CPC
This XML example shows the contents required to be supplied when POSTing a new Contract for a Campaign created from a CPC Product:
|
CPM
This XML example shows the contents required to be supplied when POSTing a new Contract for a Campaign created from a CPM Product:
|
Tenancy
This XML example shows the contents required to be supplied when POSTing a new Contract for a Campaign created from a Tenancy Product:
|
Example command:
|
GET
Retrieve the Contract with the given contractId
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
contractId the id of the Contract to be retrieved
Example command:
|
CPC
The following XML example shows the contents returned from a GET call when retrieving a CPC Contract:
|
CPM
The following XML example shows the contents returned from a GET call when retrieving a CPM Contract:
|
Tenancy
The following XML example shows the contents returned from a GET call when retrieving a Tenancy Contract:
|
PUT (contract fields)
Update the Contract with the given contractId
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
contractId the id of the Contract to be updated
CPC
This XML example shows the contents that can be supplied when updating an existing Contract for a Campaign created from a CPC Product:
|
CPM
This XML example shows the contents that can be supplied when updating an existing Contract for a Campaign created from a CPM Product:
|
Note that the ability to update startDate, endDate and requiredImpressions for a CPM Contract will be available shortly (estimated mid August 2015).
Tenancy
This XML example shows the contents that can be supplied when updating an existing Contract for a Campaign created from a Tenancy Product:
|
PUT (contract status)
Update the status of the Contract with the given contractId
|
Parameters:
-
cxadbaseurl the base URL of the Cxense Advertising system
-
contractId the id of the Contract to be updated
A Contract can have one of the following statuses:
-
LIVE
-
PAUSED
-
STOPPED
Only the following status changes are valid:
-
From LIVE to PAUSED
-
From LIVE to STOPPED
-
From PAUSED to LIVE
-
From PAUSED to STOPPED
CPC
This XML example shows the contents that should be supplied when unpausing a Contract for a Campaign created from a CPC Product:
|
CPM
This XML example shows the contents that should be supplied when pausing a Contract for a Campaign created from a CPM Product:
|
Tenancy
This XML example shows the contents that should be supplied when stopping a Contract for a Campaign created from a Tenancy Product:
|