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
| Parameter | Type | Description | 
|---|---|---|
| auditstart | Timestamp | Beginning 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. | 
| auditend | Timestamp | Ending 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(yourseatid) 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.
| Property | Description | Required? | Schema | GET | POST | PUT | DELETE | 
|---|---|---|---|---|---|---|---|
| count | The number of ads in this collection. Returned in the response of POST request to /ads | No | integer | N/A | N/A | N/A | N/A | 
| ads | An array of ad resources | Yes | objects array | N/A | Yes | Yes | N/A | 
