Querying with "where"
The "where" parameter in the API is a special field that allows a JSON-formatted where clause to allow custom filtering of the returned data. It is simplest to show an example of how one might query this API from JavaScript:
const where = JSON.stringify({
'id': {
'$eq': id,
},
});
const order = JSON.stringify([['createdAt', 'DESC NULLS LAST']]);
const options = {
url: ``${process.env.API_URL}v1/contacts?page=1&pageSize=10&where=${encodeURIComponent(where)}&order=${encodeURIComponent(order)}``,
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: ``Bearer ${access_token}``,
},
};
Additional options for the comparison include:
$eq, $gt, $gte, $lt, $lte, $ne, $like, $ilike, $in, $is $not
Updated about 2 months ago