Banner Management

getBannerListByCampaignId

Description: Get all banners from selected campaign

Implementation: URL/bnn/cam/[campaignId]

Method: GET

Json example

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

getBanner

Description: Get existing banner

Implementation: URL/bnn/[bannerId]

Method: GET

Json example

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

addBanner

Description: Add new banner

Implementation: URL/bnn/new

Method: POST/PUT

Requested parameters

addBanner
Name Description: Allowed Values Required / Optional Default
campaignId campaign ID int required
bannerName banner name string optional Untitled
storageType type of storage enum (html,txt,sql*,web*,url,video) optional null
imageURL image URL string optional null
htmlTemplate html of the banner string optional null
width width of the banner int optional null
height height of the banner int optional null
weigth weight of the banner int optional null
url destination url string optional null
bannerText Text below banner string optional null

* currently not supported

Note: the ‘iframe friendly’ setting introduced in Revive Adserver v3.2.x is currently not supported in this REST API

Json example

Method: 
    POST http://api.example.com/bnn/new
Request Header:
    Content-Type:text/javascript
Request Body:
    {
        "campaignId":3,
        "bannerName":"My new banner",
        "storageType":"url",
        "imageURL":"http://www.example.com/img.png",
        "url":"http://www.example.com",
        "width":468,
        "height":60
    }

Starting with v4.0, the addBanner function will return full details of the newly created banner, 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.


modifyBanner

Description: Modify existing banner

Implementation: URL/bnn/[bannerId]

Method: POST/PUT

Requested parameters

modifyBanner
Name Description: Allowed Values Required / Optional Default
campaignId campaign ID int optional null
bannerName banner name string optional null
storageType type of storage enum (html,txt,sql*,web*,url,video) optional null
imageURL image URL string optional null
htmlTemplate html of the banner string optional null
width width of the banner int optional null
height height of the banner int optional null
weight weight of the banner int optional null
url destination url string optional null
bannerText Text below banner string optional null

* currently not supported

Note: the ‘iframe friendly’ setting introduced in Revive Adserver v3.2.x is currently not supported in this REST API

Json example

Method: 
    POST http://api.example.com/bnn/4
Request Header:
    Content-Type:text/javascript
Request Body:
    {
        "imageURL":"http://www.example.com/image.png",
        "url":"http://www.example.com.com"
    }

deleteBanner

Description: Delete existing banner

Implementation: URL/bnn/[bannerId]

Method: DELETE

Json example

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

getBannerTargeting

Description: Returns all banner’s delivery limitations

Implementation: URL/bnn/[bannerId]/targeting

Method: GET

Json example

Method: 
    GET http://api.example.com/bnn/1/targeting

setBannerTargeting

Description: Sets delivery limitation for particular banner. All previous delivery limitation for the banner will be deleted.

Implementation: URL/bnn/[bannerId]/targeting

Method: POST/PUT

Parameters

modifyBanner
Name Description: Allowed Values Required / Optional Default
logical logical parameter enum(and,or) required
type type of the delivery limitation string required
comparison type of comparison enum (=~,!=~,==,!=,>,<….) required
data comparison data string required

Json example

Method: 
    POST http://api.example.com/bnn/1/targeting
Request Body:
[
    {
        "logical": "and",
        "type": "deliveryLimitations:Client:Browser",
        "comparison": "=~",
        "data": "FX,MZ,OP"
    },
    {
        "logical": "and",
        "type": "deliveryLimitations:Client:Ip",
        "comparison": "!=",
        "data": "10.0.0.1"
    }
]

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.