Query Expressions

Leverage our query expression language to get exactly the data you need from our APIs.

Wristband's queryable APIs support the query request parameter for filtering results. Below are the rules for using the query parameter.

Query Syntax

Queries must follow this syntax:

<attribute> <comparison_operator> "<value>" [<logical_operator> ...]

Example (URL Encoded):

GET https://yourapp-yourcompany.us.wristband.dev/api/v1/applications/123/users?query=givenName%20eq%20%22Bob%22 HTTP/2.0
Accept: application/json

Each token must be separated by whitespace. Consecutive whitespace characters are treated as a single space.

Example:

Attributes

The <attribute> values depend on the resource being queried. Refer to the specific API resource for supported attributes. Attribute values are case insensitive.

Comparison Operators

OperatorDescription
eqEquals
neNot Equals
swStarts With
ltLess Than
leLess Than or Equal
gtGreater Than
geGreater Than or Equal
inMulti-value comparison operator that resolves to true if an attribute’s value matches one of the values specified in the in value expression. The in value expression must be formatted as follows: ("<attribute_value_1>", "<attribute_value_2>", ... "<attribute_value_n>").
ninMulti-value comparison operator that resolves to true if an attribute’s value does not match one of the values specified in the nin value expression. The nin value expression must be formatted as follows: ("<attribute_value_1>", "<attribute_value_2>", ... "<attribute_value_n>").

Attribute Values

The expected format of the values is dependent on the type of the attribute. Likewise, the case sensitivity is also dependent on the attribute.

Logical Operators

Logical operators can be used to combine predicate expressions in the query. Logical operator values are case insensitive.

Logical OperatorDescription
andLogical "AND" operation
orLogical "OR" operation

Grouping Operators

Parentheses can be included in the query string to change the order of precedence when evaluating the query expression:

(email eq "[email protected]" or email eq "[email protected]") and username eq "fooBar"

Example Queries

Query For Users by Email and Status

/email eq "[email protected]" and status eq "ACTIVE"/

Query For Users by Email or Username and Family Name

/email eq "[email protected]" or username eq "bSmith" and familyName eq "Smith"/