Record listing
Record listing provides you with a list of records that conform to the given constraints. Use this when you wish to show some sort of list of available records, such as a record list. |
To list records stored under a specific module, use the GET $ComposeAPI/namespace/$NAMESPACE_ID/module/$MODULE_ID/record
endpoint.
Using filters
If you don’t need filtering simply omit this. |
When filtering over records, use module field names as |
Filters allow you to define…
- Filter by data
-
Use the
query=…
query property to specify what items should be included in the response.
We provide a SQL-like query language in the form of |
- Sorting
-
Use the
sort=…
query property to specify how to the response items should be sorted.
We provide a SQL-like sorting language in the form of |
- Pagination
-
Use the
page=…
andperPage=…
query properties to specify the pagination properties of the response.
Pagination is 1-based, meaning the first page index is 1. |
If you wish to list all items, define |
Example request
curl "$ComposeAPI/namespace/$NAMESPACE_ID/module/$MODULE_ID/record?filter=$FIELD1+LIKE+'%25$VALUE1%25'+AND+$FIELD2+LIKE+'%25$VALUE2%25'&sort=$SORT_FIELD+$SORT_DIR&page=$PAGE&perPage=$PER_PAGE" \
-H "Authorization: Bearer $JWT";
Example response
{
"response": {
"filter": {
"moduleID": "$MODULE_ID",
"namespaceID": "$NAMESPACE_ID",
"query": "$FIELD1 LIKE '%$VALUE1%' AND $FIELD2 LIKE '%$VALUE2%'",
"sort": "$SORT_FIELD $SORT_DIR",
"page": $PAGE,
"perPage": $PER_PAGE,
"count": 1(1)
},
"set": [{
"recordID": "$RECORD_ID",
"moduleID": "$MODULE_ID",
"namespaceID": "$NAMESPACE_ID",
"values": [
{ "name": "fieldName", "value": "fieldValue" }
...
]
}]
}
}
1 | The total number of records that match the provided filter. |