You are reading the documentation for an outdated Corteza release. 2024.9 is the latest stable Corteza release.

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 $PROPERTY_NAME in your expressions.

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 $PROPERTY_NAME=$VALUE [$BITWISE_OPERATOR $PROPERTY_NAME=$VALUE […​]].

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 $PROPERTY_NAME $ORDER [, $PROPERTY_NAME $ORDER[, …​]].

Pagination

Use the page=…​ and perPage=…​ 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 perPage=0.

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.