Read Data
Using the GET method, you can retrieve rows.
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:
You can evaluate multiple conditions on columns by adding more query string parameters. For instance, to return contacts that did not receive any campaign messages this month and opted in for WhatsApp marketing:
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 using AND
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:
To negate any operator, you can prefix it with 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 the select
query string parameter. For example, to retrieve only the id
and name
columns:
Ordering
The reserved word order
reorders the response rows. It uses a comma-separated list of columns and directions:
If no direction is specified it defaults to ascending order:
If you care where nulls are sorted, add nullsfirst
or nullslast
: