Filtering

Using Demand Creative Management API V1, you can filter the listings you retrieve by:

  • Last updated before a specified date
  • Last updated after a specified date

Supported Filters

ParameterTypeDescription
auditstartTimestampBeginning timestamp for the lastmod value from the Audit object, filtering returned ads by those last modified before the specified date, i.e, with a timestamp greater than this value.
auditendTimestampEnding timestamp for the lastmod value from the Audit object, filtering returned ads by those last modified on or after the specified date, i.e, with a timestamp less than or equal to this value.

Filtering Samples

📘

Account IDs: When you retrieve any resource in the Demand Creative Management API, you must specify accountid (your seatid) in the request URL.

//Request
curl -X GET \ 
https://api.freewheel.tv/demand/v1/accounts/testId2/ads?auditstart=2020-05-13T04:00:00Z \
-H 'accept: application/json'\ 
-H 'authorization: Bearer MY_OAUTH_ACCESS_TOKEN' \
//Response
{
  "count": 1,
  "offset": 0,
  "total": 1,
  "ads": [
    {
      "id": "testad2",
      "name": "test ad 2",
       "init":"2020-05-12T04:00:00Z",
       "lastmod":"2020-05-12T04:00:00Z",
      "video": {
         "curl": "http://demo.tremorvideo.com/proddev/vast/vast2RegularLinear.xml",
          "ctype":[
               2
            ]
         },
      "audit":[
          { 
          "status": 3,  
          "init":"2020-05-12T04:01:00Z",
          "lastmod":"2020-05-13T04:00:00Z", 
          "sellerid":"171213"
                }
            ]
         }
   ]
}Retrieve ads for buyer seat by last updated before specified date
//Request
curl -X GET \ https://api.freewheel.tv/demand/v1/accounts/testId2/ads?auditend=2020-05-15T04:00:00Z \ 
-H 'accept: application/json'\ 
-H 'authorization: Bearer MY_OAUTH_ACCESS_TOKEN' \
//Response
{
  "count": 1,
  "offset": 0,
  "total": 1,
  "ads": [
    {
      "id": "testad2",
      "name": "test ad 2",
       "init":"2020-05-12T04:00:00Z",
       "lastmod":"2020-05-12T04:00:00Z",
      "video": {
         "curl": "http://demo.tremorvideo.com/proddev/vast/vast2RegularLinear.xml",
          "ctype":[
               2
            ]
         },
      "audit":[
          { 
          "status": 3,  
          "init":"2020-05-12T04:01:00Z",
          "lastmod":"2020-05-13T04:00:00Z", 
          "sellerid":"171213"
                }
            ]
         }
   ]
}
//Request
curl -X GET \ https://api.freewheel.tv/demand/v1/accounts/testId/ads/testad \ 
-H 'accept: application/json'\ 
-H 'authorization: Bearer MY_OAUTH_ACCESS_TOKEN' \
//Response
{
         "id":"testad",
         "name":"Test Ad 1",
         "init":"2020-05-12T04:00:00Z",
         "lastmod":"2020-05-12T04:00:00Z",
         "video":{
            "curl":"http://demo.tremorvideo.com/proddev/vast/vast2RegularLinear.xml",
            "ctype":[
               2
            ]
         },
          "audit":[
             {
             "status": 1, 
             "init":"2020-05-12T04:01:00Z",
             "lastmod":"2020-05-12T04:01:00Z",
             "sellerid":"171213" 
              }
          ]
      }
}

Pagination

Collection of Ads

A collection of ads is an object containing one or more ads with additional metadata.

PropertyDescriptionRequired?SchemaGETPOSTPUTDELETE
countThe number of ads in this collection. Returned in the response of POST request to /adsNointegerN/AN/AN/AN/A
adsAn array of ad resourcesYesobjects arrayN/AYesYesN/A