Skip to content

Query Data

This interface allows users to fetch data based on various criteria, such as entity type, sorting, filtering, and pagination. The API endpoints and their functionalities are defined through a JSON object structure.

Query API
POST /{Category}/{Entity}/query

Caregory is the product name. it can be one of the following:

  • carewait
  • carecontrol
  • careconnect

Entity please see Entity Model List

An example JSON request for querying application data might look like this:

Query Request
{
"skip": 0,
"take": 10,
"query": {
"field1": { "$gt": 100 },
"field2": { "$in": ["value1", "value2"] }
},
"sort": {
"field1": 1,
"field2": -1
},
"fields": ["field1", "field2", "field3"],
"withoutTotal": false,
"distinct": false
}

The schema for the query request is as follows:

Field NameTypeDescription
skipIntegerNumber of records to skip (for pagination)
takeIntegerNumber of records to take (for pagination)
queryobjectDefines the filter criteria (MongoDB style query)
sortobjectSpecifies sorting order of the result fields
fieldsarraySpecifies which fields to include in the response
withoutTotalboolIf true, does not include total count of records
distinctboolIf true, returns only distinct records
  • Query: The Query field uses a MongoDB-like syntax for filtering. For instance, {"field1": {"$gt": 100}} filters records where field1 is greater than 100. For DateTime type data, please use ISO 8601 format. If you can only filter through string type, please use the Date(ISO 8601) format, for example, { modified: { $gt: "Date(2021-01-01T00:00:00Z)" } }

  • Sort: The Sort field determines the sorting order of the fields. A value of 1 indicates ascending order, and -1 indicates descending order. For example, {"field1": 1, "field2": -1} sorts by field1 in ascending and field2 in descending order.

Return object list

Query Response
{
"isSuccess": true,
"responseStatus": {
"message": "error message"
},
"data": [],
"totalCount": 0
}