generic

SEARCH: Search documents from the collection

General search operation through documents of one collection, matching the specified filtering criteria. You can apply:

  1. filtering - combining any number of filtering parameters

  2. ordering - using sort or sort$desc parameter

  3. paging - using limit and skip parameters

If successful, HTTP 200 code is returned with JSON array of matching documents as a response content (it may be empty).

This operation requires read permission for the API and the collection (e.g. *:*:read, api:*:read, *:treatments:read, api:treatments:read).

The only exception is the settings collection which requires admin permission (api:settings:admin), because the settings of each application should be isolated and kept secret. You need to know the concrete identifier to access the app's settings.

get/{collection}

Query parameters

filter_parametersstring

Any number of filtering operators.

Each filtering operator has name like <field-name>$<operator>, e.g. carbs$gt=2 which represents filtering rule "The field carbs must be present and greater than 2".

You can choose from operators:

eq=equals, insulin$eq=1.5

ne=not equals, insulin$ne=1.5

gt=greater than, carbs$gt=30

gte=greater than or equal, carbs$gte=30

lt=less than, carbs$lt=30

lte=less than or equal, carbs$lte=30

in=in specified set, type$in=sgv|mbg|cal

nin=not in specified set, eventType$nin=Temp%20Basal|Temporary%20Target

re=regex pattern, eventType$re=Temp.%2A

When filtering by field date, created_at, srvModified or srvCreated, you can choose from three input formats

  • Unix epoch in milliseconds (1525383610088)
  • Unix epoch in seconds (1525383610)
  • ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00')

The date is always queried in a normalized form - UTC with zero offset and with the correct format (1525383610088 for date, '2018-05-03T21:40:10.088Z' for created_at).

sortstring

Field name by which the sorting of documents is performed. This parameter cannot be combined with sort$desc parameter.

sort$descstring

Field name by which the descending (reverse) sorting of documents is performed. This parameter cannot be combined with sort parameter.

limitinteger
Example:100

Maximum number of documents to get in result array

skipinteger

Number of documents to skip from collection query before loading them into result array (used for pagination)

fieldsstring

A chosen set of fields to return in response. Either you can enumerate specific fields of interest or use the predefined set. Sample parameter values:

_all: All fields will be returned (default value)

date,insulin: Only fields date and insulin will be returned

Response

Successful operation returning array of documents matching the filtering criteria

statusinteger
resultDocumentArray — unresolved $ref

Changes

Changed in 5 of the 6 revisions of this API.10228

    • the endpoint scheme security accessToken was removed from the API

      api-security-removed

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 8252719e8e34211See the full diff
    • the response's body type/format changed from object/ to / for status 200

      response-body-type-changed

    • removed the success response with the status 204

      response-success-status-removed

    • the endpoint scheme security accessToken was added to the API

      api-security-added

    • the endpoint scheme security jwtoken was added to the API

      api-security-added

    • the endpoint scheme security apiKeyAuth was removed from the API

      api-security-removed

    • removed DeviceStatusArray EntryArray FoodArray ProfileArray SettingsArray TreatmentArray from the response body oneOf list for the response status 200

      response-body-one-of-removed

    • added the media type application/json for the response with the status 400

      response-media-type-added

    • added the media type application/json for the response with the status 401

      response-media-type-added

    • added the media type application/json for the response with the status 403

      response-media-type-added

    • added the media type application/json for the response with the status 404

      response-media-type-added

    • added the media type application/json for the response with the status 406

      response-media-type-added

    • added the optional property result to the response with the 200 status

      response-optional-property-added

    • added the optional property status to the response with the 200 status

      response-optional-property-added

    • added the media type application/xml for the response with the status 200

      response-media-type-added

    • added the media type text/csv for the response with the status 200

      response-media-type-added

    • added the non-success response with the status 406

      response-non-success-status-added

    • added the optional property oneOf[DeviceStatusArray]/items/allOf[DocumentBase]/isReadOnly to the response with the 200 status

      response-optional-property-added

    • added the optional property oneOf[EntryArray]/items/allOf[DocumentBase]/isReadOnly to the response with the 200 status

      response-optional-property-added

    • added the optional property oneOf[FoodArray]/items/allOf[DocumentBase]/isReadOnly to the response with the 200 status

      response-optional-property-added

    • added the optional property oneOf[ProfileArray]/items/allOf[DocumentBase]/isReadOnly to the response with the 200 status

      response-optional-property-added

    • added the optional property oneOf[SettingsArray]/items/allOf[DocumentBase]/isReadOnly to the response with the 200 status

      response-optional-property-added

    • added the optional property oneOf[TreatmentArray]/items/allOf[DocumentBase]/isReadOnly to the response with the 200 status

      response-optional-property-added

  • e3a793475629827See the full diff
    • added DeviceStatusArray EntryArray FoodArray ProfileArray SettingsArray TreatmentArray to the response body oneOf list for the response status 200

      response-body-one-of-added

    • the response's body type/format changed from / to object/ for status 200

      response-body-type-changed

    • removed the media type application/json for the response with the status 400

      response-media-type-removed

    • removed the media type application/json for the response with the status 401

      response-media-type-removed

    • removed the media type application/json for the response with the status 403

      response-media-type-removed

    • removed the media type application/json for the response with the status 404

      response-media-type-removed

    • removed the media type application/xml for the response with the status 200

      response-media-type-removed

    • removed the media type text/csv for the response with the status 200

      response-media-type-removed

    • removed the optional property result from the response with the 200 status

      response-optional-property-removed

    • removed the optional property status from the response with the 200 status

      response-optional-property-removed

    • the endpoint scheme security apiKeyAuth was added to the API

      api-security-added

    • the endpoint scheme security jwtoken was removed from the API

      api-security-removed

    • added the new optional header request parameter Date to all path's operations

      new-optional-request-default-parameter-to-existing-path

    • added the new optional query request parameter now to all path's operations

      new-optional-request-default-parameter-to-existing-path

    • added the new optional query request parameter token to all path's operations

      new-optional-request-default-parameter-to-existing-path

    • removed the non-success response with the status 406

      response-non-success-status-removed

    • added the success response with the status 204

      response-success-status-added

    This revision also has 8 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog