Passcreator Query Language

The Passcreator Query Language can be used in supported API requests to define the segment that the request should be applied on. It uses JSON to describe the query.

Sample Query

Query Components

  • Name
    templateId
    Type
    string
    (optional)
    Description

    Specifies the template you want to use.

  • Name
    projectId
    Type
    string
    (optional)
    Description

    Specifies the project you want to use.

  • Name
    searchPhrase
    Type
    string
    (optional)
    Description

    Can be used as a wildcard search over all data.

  • Name
    groups
    Type
    array<array<object>>
    (mandatory)
    Description

    Specify the search criteria.

    • Arrays [] combine with OR.
    • Objects {} combine with AND.

Condition Object Properties

Each element in the groups array is an array of condition-objects. Each condition-object has the following properties:

  • Name
    groups[].field
    Type
    string
    (mandatory)
    Description

    The field name to query.

  • Name
    groups[].operator
    Type
    string
    (mandatory)
    Description

    The comparison operator. Supported operators: equals, notEquals, contains, doesNotContain, greaterThan, greaterThanOrEquals, lowerThan, lowerThanOrEquals, beginsWith, endsWith, empty, notEmpty, isTrue, isFalse

  • Name
    groups[].value
    Type
    string | number | array
    (mandatory)
    Description

    The value(s) to compare against. When an array is provided, the values will combine with OR.

Most placeholders that you can use in Passcreator are available as fields in a criteria group. If you specify a templateId or projectId you can also use the additional properties of that template or project.

Sample Query Explanation

How The Logic Works

  • The groups array has 2 elements → Groups combine with OR
  • Each group contains condition objects → Conditions combine with AND
  • The value arrays contain multiple values → Values combine with OR

This sample Query will translate to:

All passes from template 2d1b5f7f-26df-41c6-980f-ed0709f1170d
where

firstname contains David OR Ray OR Timo
AND
country equals Germany
AND
age is greaterThan 60

OR

firstname contains Alex OR Marc
AND
country equals Spain

Sample Query

{
  "templateId": "2d1b5f7f-26df-41c6-980f-ed0709f1170d",
  "groups": [
    [
      {
        "field": "firstname",
        "operator": "contains",
        "value": ["David", "Ray", "Timo"]
      },
      {
        "field": "country",
        "operator": "equals",
        "value": ["Germany"]
      },
      {
        "field": "age",
        "operator": "greaterThan",
        "value": [60]
      }
    ],
    [
      {
        "field": "firstname",
        "operator": "contains",
        "value": ["Alex", "Marc"]
      },
      {
        "field": "country",
        "operator": "equals",
        "value": ["Spain"]
      }
    ]
  ]
}


JSON Schema

The complete JSON schema for validation and reference.

Query Language JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": ["null", "string"]
    },
    "templateId": {
      "type": ["null", "string"]
    },
    "projectId": {
      "type": ["null", "string"]
    },
    "searchPhrase": {
      "type": ["null", "string"]
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "field": {
              "type": "string"
            },
            "operator": {
              "type": "string",
              "enum": [
                "equals",
                "doesNotEqual",
                "contains",
                "doesNotContain",
                "greaterThan",
                "greaterThanOrEquals",
                "lowerThan",
                "lowerThanOrEquals",
                "beginsWith",
                "endsWith",
                "emtpy",
                "notEmpty",
                "isTrue",
                "isFalse"
              ]
            },
            "value": {
              "type": [
                "array",
                "string",
                "number"
              ]
            }
          },
          "required": [
            "field",
            "operator",
            "value"
          ]
        }
      }
    }
  }
}