Report Filtering
Parameters of the Report Filter type are similar to the Filter type except that they are used exclusively when calling functions that generate reports. The format for a Report Filter is slightly different than that of normal Filter parameters in a few ways. The conditional must always be specified using a "conditional" index. For conditionals that take value parameters, the values are specified as siblings of the conditional, indexed by the string "values". Additionally, some of the available conditionals differ between the two filter types. Report Filters do not support the "OR" construct of regular filters; instead, all provided filters are "AND"ed together.
The "EQUAL_TO" conditional behaves like an IN clause, allowing you to filter for data where the field matches one of the provided values. For example, if you are applying filters to a Conversion Report and you wish to restrict the results to conversions having either an "active" or a "pending" status, you would format the report filters as follows:
&filters[status][conditional]=EQUAL_TO&filters[status][values][0]=active&filters[status][values][1]=pending
In addition to the "EQUAL_TO" operator, following are additional comparison operators that can be used to limit results with a Report Filter.
- BETWEEN - Finds objects which have a field that is in a certain range, inclusive. Example: Retrieve conversions whose date is greater than or equal to 2013-12-29 and less than or equal to 2014-01-03
&filters[Stat.date][conditional]=BETWEEN&filters[Stat.date][values][0]=2013-12-29&filters[Stat.date][values][1]=2014-01-03
- NOT_EQUAL_TO - Finds objects which do not have the provided value. Example: Retrieve conversions whose status is not equal to "active"
&filters[Stat.conversion_status][conditional]=NOT_EQUAL_TO&filters[Stat.conversion_status][values]=active
- LESS_THAN - Finds objects which have a value less than the provided value. Example: Retrieve conversions whose id is less than 25
&filters[Stat.id][conditional]=LESS_THAN&filters[Stat.id][values]=25
- LESS_THAN_OR_EQUAL_TO - Finds objects which have a value less than or equal to the provided value. Example: Retrieve conversions whose id is less than or equal to 25
&filters[Stat.id][conditional]=LESS_THAN_OR_EQUAL_TO&filters[Stat.id][values]=25
- GREATER_THAN - Finds objects which have a value greater than the provided value. Example: Retrieve conversions whose id is greater 25
&filters[Stat.id][conditional]=GREATER_THAN&filters[Stat.id][values]=25
- GREATER_THAN_OR_EQUAL_TO - Finds objects which have a value greater than or equal to the provided value. Example: Retrieve conversions whose id is greater than or equal to 25
&filters[Stat.id][conditional]=GREATER_THAN_OR_EQUAL_TO&filters[Stat.id][values]=25
- LIKE - Returns objects which have a value that matches the provided string, using case-insensitive search. The '%' character is a wildcard: use at the beginning of the string to find values ending in that string, at the end of the string to find values beginning with that string, or in the middle to find values bookended by two parts of the string. Example: Retrieve Conversions for Offers whose names begin with "Atomic Tilt", such as "Atomic Tilt (iPhone/US)" or "Atomic Tilt (Android/SK)"
&filters[Offer.name][conditional]=LIKE&[Offer.name][values]=Atomic Tilt%
Example: Retrieve Conversions for Offers whose names have "gift card" in them, such as "$1,500 Mondo Burger Gift Card" or "Mother's Day Flowers $500 Gift Card (Incent)"
&filters[Offer.name][conditional]=LIKE&[Offer.name][values]=%gift card%
Important: If you don't use a wildcard, the call only returns values that match the provided string, though still as a case-insensitive search.
- NOT_LIKE - Returns objects which have a value that does not match the provided string. The '%' character is a wildcard, with the same function as in the LIKE operator. Example: Retrieve Conversions for Offers whose names do not contain "Free"
&filters[Offer.name][conditional]=NOT_LIKE&[Offer.name][values]=%Free%
- NULL - Finds objects which have a value that is NULL. This is not the same as an empty string; you should use the EQUAL_TO conditional to find objects whose value is an empty string. Notice no "values" are passed for this conditional. Example: Retrieve conversions whose ip is NULL
&filters[Stat.ip][conditional]=NULL
- NOT_NULL - Finds objects which have a value that is NOT NULL. This is not the same as an empty string; you should use the NOT_EQUAL_TO conditional to find objects whose value is an not an empty string. Notice no "values" are passed for this conditional. Example: Retrieve conversions whose ip is NOT NULL.
&filters[Stat.ip][conditional]=NOT_NULL
Note: Since the Report Filter does not support "TRUE" or "FALSE" conditionals, use the "EQUAL_TO" or "NOT_EQUAL_TO" conditionals instead when filtering on boolean-typed report fields. A value of "1" corresponds to boolean true, while a value of "0" corresponds to boolean false.