Filters

Overview

You can query for needed data by providing filters in the request e.g. query for one line item data or several banners statistics only. Filtered queries restrict the rows that do (or do not) get included in the result. Each row in the result is tested against the filter: if the filter matches, the row is retained and if it doesn't match, the row is dropped.

Not all filters are compatible with the set of dimensions and metrics provided in the request. Currently, the only way to check if combination is valid is to execute the query itself. When filter is not specified, all user accessible values are being retrieved.

Parameters

Filter PropertyParameterAccepted valuesRequiredExample
date

preset intervals

singleyes

"date": "today"

 

specified date period (from/to)single"date": { "from": "2014-11-01", "to": "2014-11-15" }
clientidmultipleno"client": [ 12, 13 ] or "client": { "id": [ 12, 13 ] }
namemultiple"client": { "name": [ "name_12", "name_13" ] }
campaignidmultipleno"campaign": [ 1222, 1333 ] or"campaign": { "id": [ 1222, 1333 ] }
namemultiple"campaign": { "name": [ "campaign_name_1222", "campaign_name_1333" ] }

demandPartner

idmultipleno"demandPartner": [ 4852, 44782 ] or "demandPartner": { "id": [ 4852, 44782 ] }
namemultiple"demandPartner": { "name": [ "demandPartner-01", "demandPartner-02" ] }
lineItemidmultipleno"lineItem": [ 11456, 12312 ] or "lineItem": { "id": [ 11456, 12312 ] }
namemultiple

"lineItem": { "name": [ "bp-01", "bp-top" ] }

publisheridmultipleno"publisher": [ 246344, 33445 ] or "publisher": { "id": [ 246344, 33445 ] }
namemultiple"publisher": { "name": [ "publisher1", "publisher2" ] }
placementidmultipleno"placement": [ 11456, 12312 ] or "placement": { "id": [ 11456, 12312 ] }
namemultiple"placement": { "name": [ "bp-01", "bp-top" ] }
demandSourceidmultipleno"demandSource": [ 11541, 11542 ] or "demandSource": { "id": [ 11541, 11542 ] }
namemultiple"demandSource": { "name": [ "demandSource-01", "demandSource-02" ] }
sourcesingleno

"demandSource" : { "source" : ["Real-Time"] } or

"demandSource" : { "source" : ["Direct"] }

buyeridmultipleno
 
"buyer": [ 637849, 974620] or "buyer": { "id": [ 637849, 974620] }
namemultiple"buyer": { "name": [ "buyer1", "buyer2" ] }

Sample


        {
   "filter": {
      "date": "pastThirtyDays",
      "client": {
         "id": [12, 13, 14],
         "name": ["name_12", "name_13", "name_15"]
      },
      "campaign": {
         "id": [1222, 1333]
      }
   },
   "metrics": [ ... ],
 ...
}
    

Conditions

When specifying filter parameters such as names, IDs or preset values, the exactly matching values are being searched for. Case sensitivity is considered for name and preset values.

E.g. if campaign name available in the system is "December_2015 - campaign" and user specifies "December 2015 campaign" in the request, no matching result will be returned for such filter.

Note: When applying multiple filters to the request, AND operation applies among the different filter conditions. Among the same filter property values (array), OR operation is being applied. See example below.


        {
   "filter": {
      "date": "pastThirtyDays",
      "client": {
         "name": ["name_12", "name_13"] // OR condition is applied within the same filter condition values, either data for client name_12 or name_13 will be reported.
      },
     "campaign": { 
        "name": [ "campaign_12"] 
      }
   }, // Statistics will be returned for campaign_12, for clients name_12 or name_13 for the last 30 days period.
   "metrics": [ ... ],
 ...
}
    
Help

Still have questions?

If you can't find an answer to your question here, email our Support team