generic

READ: Retrieves a single document from the collection

Basically this operation looks for a document matching the identifier field returning 200 or 404 HTTP status code.

If the document has been found in the collection but it had already been deleted, 410 HTTP status code is to be returned.

When If-Modified-Since header is used and its value is greater than the timestamp of the document in the collection, 304 HTTP status code with empty response content is returned. It means that the document has not been modified on server since the last retrieval to client side. With If-Modified-Since header and less or equal timestamp srvModified a normal 200 HTTP status with full response is returned.

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

get/{collection}/{identifier}

Query parameters

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

Headers

If-Modified-Sincestring

Timestamp (defined with respect to server's clock) of the last document modification formatted as:

<day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT

If this header is present, the operation will compare its value with the srvModified timestamp of the document at first and the operation result then may differ. The srvModified timestamp was defined by server's clock.

Example:

<pre>If-Modified-Since&#58; Wed, 17 Oct 2018 05&#58;13&#58;00 GMT</pre>

Response

The document has been succesfully found and its JSON form returned in the response content.

statusinteger

Example response

{
  "status": 200,
  "result": {
    "identifier": "53409478-105f-11e9-ab14-d663bd873d93",
    "date": 1525383610088,
    "utcOffset": 120,
    "app": "xdrip",
    "device": "dexcom G5",
    "_id": "58e9dfbc166d88cc18683aac",
    "srvCreated": 1525383610088,
    "subject": "uploader",
    "srvModified": 1525383610088,
    "modifiedBy": "admin",
    "isReadOnly": true
  }
}

Changes

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

    • 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

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

      response-body-type-changed

    • 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 DeviceStatus Entry Food Profile Settings Treatment 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 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 media type application/json for the response with the status 410

      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[DeviceStatus]/allOf[DocumentBase]/isReadOnly to the response with the 200 status

      response-optional-property-added

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

      response-optional-property-added

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

      response-optional-property-added

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

      response-optional-property-added

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

      response-optional-property-added

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

      response-optional-property-added

  • e3a793475629826See the full diff
    • added DeviceStatus Entry Food Profile Settings Treatment 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 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/json for the response with the status 410

      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

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