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

Folder REST API

Much like a computer's filesystem the Cxense Advertising platform structures its inventory items in the form of a tree of Folders. The structure of this tree (ie. the name and location of the Folders that make it up) can be managed via the Folder REST API.

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

Object

Supported operations

Folder

POST, GET, PUT and DELETE

Individual Folders

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

POST

Create a new Folder under the specified Folder

https://{cxadbaseurl}/api/secure/folder/{folderCode}

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • folderCode- can either be:

    • the folderId of an existing Folder (can be determined as detailed in Folder REST API - GET operation below)

    • the string "advertising" to retrieve the containers immediately visible when clicking on the Advertising tab in the Cxense Advertising user interface

    • the string "publishing" to retrieve the containers immediately visible when clicking on the Publishing tab in the Cxense Advertising user interface

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:folder xmlns:cx="http://cxense.com/cxad/api/cxad">
  <cx:name>Test Folder</cx:name>
</cx:folder>

Example commands:

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

GET

Retrieve the specified Folder and the folderIds of each of its child Folders.

https://{cxadbaseurl}/api/secure/folder/{folderCode}

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • folderCode- can either be:

    • the folderId of an existing Folder

    • the string "advertising" to retrieve the containers immediately visible when clicking on the Advertising tab in the Cxense Advertising user interface

    • the string "publishing" to retrieve the containers immediately visible when clicking on the Publishing tab in the Cxense Advertising user interface

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

 Click to view XML example

<?xml version="1.0"?>
<cx:folder xmlns:cx="http://cxense.com/cxad/api/cxad">
  <cx:folderId>00000000000063a4</cx:folderId>
  <cx:name>container:advertising</cx:name>
  <cx:childFolder>
    <cx:folderId>00000000000063d3</cx:folderId>
    <cx:name>Advertising Account</cx:name>
  </cx:childFolder>
  <cx:childFolder>
    <cx:folderId>00000000000063e9</cx:folderId>
    <cx:name>Advertising Competing Account</cx:name>
  </cx:childFolder>
</cx:folder>

Example commands:

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

PUT

Update the Folder with the given folderId

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

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • folderId the id of the Folder to be updated

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

 Click to view XML example

<?xml version="1.0"?>
<cx:folder xmlns:cx="http://cxense.com/cxad/api/cxad">
  <cx:name>container:advertising</cx:name>
</cx:folder>

Example commands:

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

DELETE

Delete the Folder with the given folderId

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

Parameters:

  • cxadbaseurl the base URL of the Cxense Advertising system

  • folderId the id of the Folder to be deleted

Example commands:

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


Last updated: