We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

AdSpace REST API

This API exposes operations to allow management of AdSpaces within the Cxense Advertising platform.

This API can be accessed by users with the appropriate permissions to manage AdSpaces and supports the following combination of operations on AdSpace domain objects:

Object

Supported operations

AdSpace

POST, GET, PUT and DELETE

AdSpace list

GET

Retrieving the list of AdSpaces within a Publishing Folder

The GET operation is supported for listing AdSpaces stored in a folder.

GET

Retrieve all of the AdSpaces contained within the Folder with the given folderId.

https://{cxadbaseurl}/api/secure/adSpaces/{folderId}

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • folderId the id of the Folder for which the AdSpaces are to be retrieved (can be determined as detailed in Folder REST API - GET operation)

Example commands:

curl -s -H "Content-type: text/xml" -u jsmith123:password1 -X GET https://cxad.cxense.com/api/secure/adSpaces/00000000000392f2

This XML example shows the contents returned from a typical GET call:

<?xml version="1.0"?>
<cx:adSpaces xmlns:cx="http://cxense.com/cxad/api/cxad">
  <cx:adSpace>
    <cx:adSpaceId>0000000000001112</cx:adSpaceId>
    <cx:name>AdSpace 1</cx:name>
    <cx:adCount>3</cx:adCount>
    <cx:width>600</cx:width>
    <cx:height>150</cx:height>
    <cx:adWidth>200</cx:adWidth>
    <cx:adHeight>150</cx:adHeight>
    <cx:behaviouralWeight>80</cx:behaviouralWeight>
    <cx:contextualWeight>10</cx:contextualWeight>
    <cx:minimumPrice currencyCode="AUD" value="10.00"></cx:minimumPrice>
    <cx:orientation>HORIZONTAL</cx:orientation>
    <cx:feeds>
      <cx:feedId group="0">0000000000004abc</cx:feedId>
      <cx:feedId group="1">000000000000123a</cx:feedId>
    </cx:feeds>
  </cx:adSpace>
  <cx:adSpace>
    <cx:adSpaceId>0000000000001144</cx:adSpaceId>
    <cx:name>AdSpace 2</cx:name>
    <cx:adCount>1</cx:adCount>
    <cx:width>100</cx:width>
    <cx:height>500</cx:height>
    <cx:adWidth>100</cx:adWidth>
    <cx:adHeight>500</cx:adHeight>
    <cx:behaviouralWeight>0</cx:behaviouralWeight>
    <cx:contextualWeight>100</cx:contextualWeight>
    <cx:minimumPrice currencyCode="AUD" value="10.00"></cx:minimumPrice>
    <cx:orientation>VERTICAL</cx:orientation>
    <cx:feeds>
      <cx:feedId group="0">0000000000004xyz</cx:feedId>
    </cx:feeds>
  </cx:adSpace>
</cx:adSpaces>

Individual AdSpaces

The POST, GET, PUT and DELETE operations are supported for management of individual AdSpaces.

POST

In order to be able to create a AdSpace the user must first decide in what location (or Folder) the AdSpace is to be created.

A list of Folders at any given point in the tree of publishing folders can be retrieved, starting from the top-level Publishing 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 AdSpace under the Folder with the given folderId

https://{cxadbaseurl}/api/secure/adSpace/{folderId}

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • folderId the id of the Folder under which the new AdSpace is to be created (can be determined as detailed in Folder REST API - GET operation)

This XML example shows the contents required to be supplied for a POST call:

 Click to view XML example

<?xml version="1.0" encoding="UTF-8"?>
<cx:adSpace xmlns:cx="http://cxense.com/cxad/api/cxad">
  <cx:name>AdSpace 1</cx:name>
  <cx:adCount>3</cx:adCount>
  <cx:width>600</cx:width>
  <cx:height>150</cx:height>
  <cx:adWidth>200</cx:adWidth>
  <cx:adHeight>150</cx:adHeight>
  <cx:behaviouralWeight>80</cx:behaviouralWeight>
  <cx:contextualWeight>10</cx:contextualWeight>
  <cx:minimumPrice currencyCode="AUD" value="10.00"></cx:minimumPrice>
  <cx:orientation>HORIZONTAL</cx:orientation>
  <cx:feeds>
    <cx:feedId group="0">0000000000004abc</cx:feedId>
    <cx:feedId group="1">000000000000123a</cx:feedId>
  </cx:feeds>
</cx:adSpace>

Example commands:

curl -s -H "Content-type: text/xml" -u jsmith123:password1 -X POST https://cxad.cxense.com/api/secure/adSpace/publishing -d @input.xml
curl -s -H "Content-type: text/xml" -u jsmith123:password1 -X POST https://cxad.cxense.com/api/secure/adSpace/00000000000392f2 -d @input.xml

GET

Retrieve the AdSpace with the given adSpaceId

https://{cxadbaseurl}/api/secure/adSpace/{adSpaceId}

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • adSpaceId the id of the AdSpace to be retrieved

Example command:

curl -s -H "Content-type: text/xml" -u jsmith123:password1 -X GET https://cxad.cxense.com/api/secure/adSpace/0000000000039306

This XML example shows the contents returned from a typical GET call:

<?xml version="1.0" encoding="UTF-8"?>
<cx:adSpace xmlns:cx="http://cxense.com/cxad/api/cxad">
  <cx:adSpaceId>0000000000001112</cx:adSpaceId>
  <cx:name>AdSpace 1</cx:name>
  <cx:adCount>3</cx:adCount>
  <cx:width>600</cx:width>
  <cx:height>150</cx:height>
  <cx:adWidth>200</cx:adWidth>
  <cx:adHeight>150</cx:adHeight>
  <cx:behaviouralWeight>80</cx:behaviouralWeight>
  <cx:contextualWeight>10</cx:contextualWeight>
  <cx:orientation>HORIZONTAL</cx:orientation>
  <cx:feeds>
    <cx:feedId group="0">0000000000004abc</cx:feedId>
    <cx:feedId group="1">000000000000123a</cx:feedId>
  </cx:feeds>
</cx:adSpace>

PUT

Update the AdSpace with the given adSpaceId

https://{cxadbaseurl}/api/secure/adSpace/{adSpaceId}

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • adSpaceId the id of the AdSpace to be updated

Example command:

curl -s -H "Content-type: text/xml" -u jsmith123:password1 -X PUT https://cxad.cxense.com/api/secure/adSpace/0000000000039306 -d @input.xml

DELETE

Delete the AdSpace with the given adSpaceId

https://{cxadbaseurl}/api/secure/adSpace/{adSpaceId}

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • adSpaceId the id of the AdSpace to be deleted

Example command:

curl -s -H "Content-type: text/xml" -u jsmith123:password1 -X DELETE https://cxad.cxense.com/api/secure/adSpace/0000000000039306


Last updated: