Filtering

Operator-based filtering for ADP API queries

Filtering

The ADP API uses operator-based filtering to query specific data across all GraphQL operations.

Filter Format

Syntax: {"field": {"operator": value}}

All filters use JSON objects with explicit operators. Direct value assignment is NOT supported.

Supported Operators

OperatorDescriptionExample
=Equality{"lineitem_type": {"=": "DISPLAY"}}
!=Not equal{"lineitem_status": {"!=": "ARCHIVED"}}
>Greater than{"lineitem_id": {">": 1000}}
<Less than{"lineitem_id": {"<": 5000}}
>=Greater or equal{"deal_value": {">=": 100}}
<=Less or equal{"deal_value": {"<=": 1000}}
inIn array{"lineitem_id": {"in": [1, 2, 3]}}
likePattern match{"lineitem_name": {"like": "%campaign%"}}

Examples

Single Filter

query GetDisplayLineitems($filter: JSON) {
  dream_adserver {
    lineitems(filter: $filter) {
      edges {
        lineitem_id
        lineitem_name
        lineitem_type
      }
      total_count
    }
  }
}

Variables:

{
  "filter": {
    "lineitem_type": {"=": "DISPLAY"}
  }
}

Multiple Filters (AND Logic)

Multiple filters in one object are combined with AND logic:

{
  "filter": {
    "lineitem_type": {"=": "DISPLAY"},
    "lineitem_is_archived": {"=": false},
    "lineitem_start_date": {"<=": "2025-12-31 23:59:59"}
  }
}

Array Filter (IN Operator)

{
  "filter": {
    "lineitem_id": {"in": [12345, 12346, 12347]}
  }
}

Pattern Matching (LIKE Operator)

Use % as wildcard for pattern matching:

{
  "filter": {
    "lineitem_name": {"like": "%holiday%"}
  }
}
  • "%holiday%" - Contains "holiday" anywhere
  • "holiday%" - Starts with "holiday"
  • "%holiday" - Ends with "holiday"

Common Mistakes

❗️

❌ WRONG: Direct value assignment

{
  "filter": {
    "lineitem_type": "DISPLAY"
  }
}

✅ CORRECT: Operator-based syntax

{
  "filter": {
    "lineitem_type": {"=": "DISPLAY"}
  }
}
❗️

❌ WRONG: String instead of boolean

{
  "filter": {
    "lineitem_is_archived": {"=": "false"}
  }
}

✅ CORRECT: Boolean literal

{
  "filter": {
    "lineitem_is_archived": {"=": false}
  }
}

Best Practices

  • Use double quotes for operator keys: {"=": value} not {=: value}
  • Boolean values: use true/false (not strings "true"/"false")
  • String values: use quotes "DISPLAY" (not unquoted DISPLAY)
  • All filters in one object are combined with AND logic
  • Use in operator for multiple value matching

Next Steps

  • Learn about Sorting with lowercase directions
  • Master Pagination for large result sets