Querying Tables
POST
/api/table/{table_id}/records/query
Parameters
name | type | description |
---|---|---|
search |
string | optional search string for partial matches |
filters |
array | optional array of filter conditions (see below) |
fields |
array | optional array of field id's to include |
order_by |
string | optional field id to order by |
order_dir |
string | optional direction to order by (ASC or DESC ) |
limit |
integer | maximum number of records to return - max 1000 |
offset |
integer | offset into the result set |
Filters
The filters
parameter is an array of the following keys:
name | type | description |
---|---|---|
field |
string | field id |
compare |
string | compare function (see below) |
value |
string | value to match on |
Compare functions
name | description |
---|---|
EQ |
equal to |
NE |
not equal to |
LT |
less than |
LE |
less than or equal to |
GT |
greater than |
GE |
greater than or equal to |
C |
contains |
NC |
not contains |
Example
$ curl -X POST "https://infolobby.com/api/table/123/records/query"
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
-H "Content-Type: application/json"
-d '{"filters":[{"field":"name","compare":"C","value":"foo"}],"fields":["name","age"]}'
Sample Response
[
{
"item_id": 1,
"name": "foo",
"age": 21
},
{
"item_id": 2,
"name": "foobar",
"age": 22
}
]
Notes
If you're not sure of a table's ID, you can get it from the developer tab in the table settings in InfoLobby.
If you need hints on what the id's of the fields are, make a request to:
GET
/api/table/{table_id}/get
And have a look at the appFields
array in the response.