Horizontal Filtering
You can filter result rows by adding conditions on columns. For instance, to lookup contacts that did not receive any campaign messages this month:Operators
These operators are available:Abbreviation | Meaning |
---|---|
eq | equals |
gt | greater than |
gte | greater than or equal |
lt | less than |
lte | less than or equal |
neq | not equal |
like | LIKE operator (to avoid URL encoding you can use * as an alias of the percent sign % for the pattern) |
ilike | ILIKE operator (to avoid URL encoding you can use * as an alias of the percent sign % for the pattern) |
in | one of a list of values, e.g. ?a=in.(1,2,3) — also supports commas in quoted strings like ?a=in.("hi,there","yes,you") |
is | checking for exact equality (null,true,false,unknown) |
isdistinct | not equal, treating NULL as a comparable value |
cs | contains e.g. ?tags=cs.{example, new} |
cd | contained in e.g. ?values=cd.{1,2,3} |
not | negates another operator, see Logical Operators |
or | logical OR , see Logical Operators |
and | logical AND , see Logical Operators |
Logical Operators
Multiple conditions on columns are evaluated usingAND
by default, but you can combine them using OR
with the or
operator. For example, to return contacts with either a SMS or a WhatsApp marketing opt in:
not
like ?a=not.eq.2
or ?not.and=(a.gte.0,a.lte.100)
.
Vertical Filtering
To be more effiecient, it is always wise to retrieve only the columns you need. You can do this by specifying the columns in theselect
query string parameter. For example, to retrieve only the id
and name
columns:
Ordering
The reserved wordorder
reorders the response rows. It uses a comma-separated list of columns and directions:
nullsfirst
or nullslast
: