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)
Query parameters
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
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: Wed, 17 Oct 2018 05:13:00 GMT</pre>Response
The document has been succesfully found and its JSON form returned in the response content.
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
}
}