Campaign Management

getCampaignListByAdvertiserID

Description: Returns the existing campaigns under the requested advertiser

Implementation: URL/cam/adv/[advertiserId]

Method: GET

Json example

Method: 
    GET http://api.example.com/cam/adv/1

getCampaign

Description: Get the details of one specific campaign

Implementation: URL/cam/[campaignId]

Method: GET

Json example

Method: 
    GET http://api.example.com/cam/1

addCampaign

Description: Add a new campaign

Implementation: URL/cam/new

Method: POST/PUT

Requested parameters:

addCampaign
Name Description: Allowed Values Required / Optional Default
advertiserId id of the advertiser int required
campaignName name of the campaign string optional Untitled
startDate start date of the campaign date (yyyy-mm-dd) optional starts immediately
endDate end date of the campaign date (yyyy-mm-dd) optional don’t expire
impressions booked impressions int optional -1
clicks booked clicks int optional -1
priority campaign priority int optional 0-remnant, 1-contract, 2-override
weight campaign weight int optional null

Pro tip

The easiest way to find out which campaign parameters exist, but more importantly in which combination they work together, is to create a campaign in the Revive Adserver user interface, and then to retrieve the details of that campaign through the API using the getCampaign method described above. This will show all campaign parameters as entered, but now returned in JSON formatting. This is particularly useful to find out how to combine things like campaign type, start date, end date and number of impressions (for example).

Json example

Method: 
    POST http://api.example.com/cam/new
Request Header:
    Content-Type:text/javascript
Request Body:
    {
        "advertiserId": 1,
        "campaignName": "New campaign",
        "startDate": "2016-09-01",
        "endDate": "2016-12-31"
    }

Starting with v4.0, the addCampaign function will return full details of the newly created campaign, instead of just {“OK”}. This enables developers to quickly retrieve the ID of the newly created entity, and to check the default values assigned to attributes that were not included in the call to create the new entity.


modifyCampaign

Description: Modify an existing campaign

Implementation: URL/cam/[campaignId]

Method: POST/PUT

Requested parameters: See above with “addCampaign”

Json example

Method: 
    POST http://api.example.com/cam/4
Request Header:
    Content-Type:text/javascript
Request Body:
    {
        "campaignName": "Modified campaign",
        "startDate": "2016-10-01",
        "endDate": "2016-12-31"
    }

deleteCampaign

Description: Delete existing campaign

Implementation: URL/cam/[campaignId]

Method: DELETE

Json example

Method: 
    DELETE http://api.example.com/cam/4

getZoneListByCampaignID

Description: get a list of all zones a specific campaign is linked to.

Notes:

  • This method has been added in version 4.0.0
  • A bug in this method’s output has been fixed in v4.1.0
  • Starting with v4.1.0, this method returns an unnamed array of all zones (breaking change).

Implementation: /URL/zon/cam/[campaignId]

Method: GET

Json example

Method: 
    GET http://api.example.com/zon/cam/4

Current version

The most recently released version of the Revive Adserver REST API is v4.2.0 (publication date July 12, 2017).

See Release Notes

Compatibility

Revive Adserver REST API is compatible with all versions of Revive Adserver v4.0 and higher. It may also be compatible with Revive Adserver v3.x (and also with OpenX Source v2.8 and higher), but this can not be guaranteed.

Revive Adserver REST API is compatible with all supported versions of PHP, including PHP7.

Also see Technical Requirements, Product Content, and Installation Instructions.

Our Recent Tweets