This section is broken down into Browse Content and Search. Browse Content is a simple method of getting or reading the content of a database table. It can be optionally combined with paging.
Search is an advanced method of filtering, sorting, and paging database content. It is flexible and powerful and enables you to return content based on the parameters you define.
Please note that the Metadata APIs for browsing content do not react to API Access settings. All fields will be returned regardless of this setting.
Browse Content
Browse table content is a simple method of getting content (database records) in a database table. It requires a workspace ID and table ID, while paging is optional.
Notice how the or is formatted after the Price is > 70 expression.
Example response body:
{
"items": [
{
"id": 1,
"created_at": 1681336868222,
"name": "Basketball",
"description": "round ball to shoot hoops",
"category_id": 1,
"price": 10
},
{
"id": 2,
"created_at": 1681336868456,
"name": "French Press",
"description": "Make delicious coffee with this",
"category_id": 2,
"price": 5
},
{
"id": 4,
"created_at": 1681336868931,
"name": "Camera",
"description": "Take photos with this",
"category_id": 3,
"price": 80
},
{
"id": 6,
"created_at": 1681346183823,
"name": "Resistance Bands",
"description": "Stretchy bands for working out",
"category_id": 1,
"price": 15
},
{
"id": 7,
"created_at": 1681346184107,
"name": "Tablet",
"description": "Browse, stream, and more with a portable tablet",
"category_id": 3,
"price": 120
},
{
"id": 10,
"created_at": 1681346185431,
"name": "Air Fryer",
"description": "A new way to fry food without all the grease and oil",
"category_id": 2,
"price": 75
}
],
"itemsReceived": 6,
"curPage": 1,
"nextPage": null,
"prevPage": null,
"offset": 0,
"itemsTotal": 6,
"pageTotal": 1
}
In and Not In
The IN and NOT IN operators are great for working with lists and can also be thought of as another version of "or" operators. In the first example, we will search where the ID is IN [2,3,7].
In the second example, we will search where ID is NOT IN [1,2,3,4,6,7,8,9]
Example request body:
{
"search": {
"id|not in": [1,2,3,4,6,7,8,9]
}
}
Example response body:
{
"items": [
{
"id": 5,
"created_at": 1681346183608,
"name": "Microwave",
"description": "Reheat leftovers quickly",
"category_id": 2,
"price": 40
},
{
"id": 10,
"created_at": 1681346185431,
"name": "Air Fryer",
"description": "A new way to fry food without all the grease and oil",
"category_id": 2,
"price": 75
}
],
"itemsReceived": 2,
"curPage": 1,
"nextPage": null,
"prevPage": null,
"offset": 0,
"itemsTotal": 2,
"pageTotal": 1
}
Sort
Sort is flexible, like search, in the sense that it accepts a single object or an array for a single sort parameter. It also supports multiple sorts, which require an array format.
Single Sort
In this example, we will sort the category table by the name in ascending order.