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
}
}Changes
Changed in 5 of the 6 revisions of this API.9227
- ○
the endpoint scheme security
accessTokenwas removed from the APIapi-security-removed
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ▲
the response's body type/format changed from
object/to/for status200response-body-type-changed
- ○
the endpoint scheme security
accessTokenwas added to the APIapi-security-added
- ○
the endpoint scheme security
jwtokenwas added to the APIapi-security-added
- ○
the endpoint scheme security
apiKeyAuthwas removed from the APIapi-security-removed
- ○
removed
DeviceStatusEntryFoodProfileSettingsTreatmentfrom the response bodyoneOflist for the response status200response-body-one-of-removed
- ○
added the media type
application/jsonfor the response with the status401response-media-type-added
- ○
added the media type
application/jsonfor the response with the status403response-media-type-added
- ○
added the media type
application/jsonfor the response with the status404response-media-type-added
- ○
added the media type
application/jsonfor the response with the status406response-media-type-added
- ○
added the media type
application/jsonfor the response with the status410response-media-type-added
- ○
added the optional property
resultto the response with the200statusresponse-optional-property-added
- ○
added the optional property
statusto the response with the200statusresponse-optional-property-added
- ▲
- ○
added the media type
application/xmlfor the response with the status200response-media-type-added
- ○
added the media type
text/csvfor the response with the status200response-media-type-added
- ○
added the non-success response with the status
406response-non-success-status-added
- ○
- ○
added the optional property
oneOf[DeviceStatus]/allOf[DocumentBase]/isReadOnlyto the response with the200statusresponse-optional-property-added
- ○
added the optional property
oneOf[Entry]/allOf[DocumentBase]/isReadOnlyto the response with the200statusresponse-optional-property-added
- ○
added the optional property
oneOf[Food]/allOf[DocumentBase]/isReadOnlyto the response with the200statusresponse-optional-property-added
- ○
added the optional property
oneOf[Profile]/allOf[DocumentBase]/isReadOnlyto the response with the200statusresponse-optional-property-added
- ○
added the optional property
oneOf[Settings]/allOf[DocumentBase]/isReadOnlyto the response with the200statusresponse-optional-property-added
- ○
added the optional property
oneOf[Treatment]/allOf[DocumentBase]/isReadOnlyto the response with the200statusresponse-optional-property-added
- ○
- ▲
added
DeviceStatusEntryFoodProfileSettingsTreatmentto the response bodyoneOflist for the response status200response-body-one-of-added
- ▲
the response's body type/format changed from
/toobject/for status200response-body-type-changed
- ▲
removed the media type
application/jsonfor the response with the status401response-media-type-removed
- ▲
removed the media type
application/jsonfor the response with the status403response-media-type-removed
- ▲
removed the media type
application/jsonfor the response with the status404response-media-type-removed
- ▲
removed the media type
application/jsonfor the response with the status410response-media-type-removed
- ▲
removed the media type
application/xmlfor the response with the status200response-media-type-removed
- ▲
removed the media type
text/csvfor the response with the status200response-media-type-removed
- ●
removed the optional property
resultfrom the response with the200statusresponse-optional-property-removed
- ●
removed the optional property
statusfrom the response with the200statusresponse-optional-property-removed
- ○
the endpoint scheme security
apiKeyAuthwas added to the APIapi-security-added
- ○
the endpoint scheme security
jwtokenwas removed from the APIapi-security-removed
- ○
added the new optional
headerrequest parameterDateto all path's operationsnew-optional-request-default-parameter-to-existing-path
- ○
added the new optional
queryrequest parameternowto all path's operationsnew-optional-request-default-parameter-to-existing-path
- ○
added the new optional
queryrequest parametertokento all path's operationsnew-optional-request-default-parameter-to-existing-path
- ○
removed the non-success response with the status
406response-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
- ▲