Skip to content

Upload new device logs as json

Request

Uploads a new device logs json to the user's account. The Digest header must represent the MD5 hash of the json data content.

Security
sessionToken
Path
userIdstring(Tidepool User ID)^([0-9a-f]{10}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-...read-onlyrequired

Tidepool User ID

Headers
Digeststring, = 28 characters^md5=(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}...required

Base64-encoded MD5 hash of the resource, per RFC 3230

Example:md5=HUXZLQLMuI/KZ5KDcJPcOA==
X-Logs-Start-At-Timestring, (date-time)(Date/Time)required

Starting time of device logs inside the uploaded json log

Example:2017-02-06T02:37:46Z
X-Logs-End-At-Timestring, (date-time)(Date/Time)required

End time of device logs inside the uploaded json log

Example:2017-02-06T02:37:46Z
Bodyapplication/jsonrequired

array of JSON data

Array [
typestringrequired
Enum:"send""receive""error""delegate""delegateResponse""connection"
Example:"send"
managerIdentifierstring, non-empty(Device Model Name)required

A string identifying the model of the device.

The deviceModel is a non-empty string that encodes the model of device. We endeavor to match each manufacturer's standard for how they represent model name in terms of casing, whether parts of the name are represented as one word or two, etc.

Example:"Devicey McDeviceface"
deviceIdentifierstring, non-empty(Device ID)required

Globally unique to device and repeatable with each upload, e.g. device make and model with serial number

Example:"MMT-1711:12345678"
timestampstring, (date-time)(Date/Time)required

RFC 3339 / ISO 8601 timestamp with timezone information

Example:"2017-02-06T02:37:46Z"
messagestring, non-emptyrequired
Example:"sent something ..."
]
curl -i -X POST \
  'https://tidepool.redocly.app/_mock/reference/blob.v1/v1/users/{userId}/device_logs' \
  -H 'Content-Type: application/json' \
  -H 'Digest: md5=HUXZLQLMuI/KZ5KDcJPcOA==' \
  -H 'X-Logs-End-At-Time: 2017-02-06T02:37:46Z' \
  -H 'X-Logs-Start-At-Time: 2017-02-06T02:37:46Z' \
  -H 'X-Tidepool-Session-Token: YOUR_API_KEY_HERE' \
  -d '[
    {
      "type": "send",
      "managerIdentifier": "Devicey McDeviceface",
      "deviceIdentifier": "MMT-1711:12345678",
      "timestamp": "2017-02-06T02:37:46Z",
      "message": "sent something ..."
    }
  ]'

Responses

Device logs metadata

Bodyapplication/json
idstring(Blob ID)^[0-9a-z]{32}$read-onlyrequired

Blob ID

Example:"97a9fae8a19b4da58bb48dc90c9562c9"
userIdstring(Tidepool User ID)^([0-9a-f]{10}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-...read-onlyrequired

String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit UUID v4

Example:"4d94a5fb-642e-48f1-89b9-c6a3e6145342"
digestMD5string, = 24 characters(MD5 Digest)^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[...required

MD5 digest of the content per RFC 1321, encoded as base64 (RFC 4648).

Example:"HUXZLQLMuI/KZ5KDcJPcOA=="
mediaTypestringrequired
Value:"application/json"
Example:"application/json"
sizeinteger, (int64)(Blob Size)read-onlyrequired

Size of the binary blob, in bytes

Example:1024
createdTimestring, (date-time)(Date/Time)required

RFC 3339 / ISO 8601 timestamp with timezone information

Example:"2017-02-06T02:37:46Z"
startAtTimestring, (date-time)(Date/Time)required

RFC 3339 / ISO 8601 timestamp with timezone information

Example:"2017-02-06T02:37:46Z"
endAtTimestring, (date-time)(Date/Time)required

RFC 3339 / ISO 8601 timestamp with timezone information

Example:"2017-02-06T02:37:46Z"
Response
{ "id": "97a9fae8a19b4da58bb48dc90c9562c9", "userId": "4d94a5fb-642e-48f1-89b9-c6a3e6145342", "digestMD5": "HUXZLQLMuI/KZ5KDcJPcOA==", "mediaType": "application/json", "size": 1024, "createdTime": "2017-02-06T02:35:46Z", "startAtTime": "2017-02-06T02:35:46Z", "endAtTime": "2017-02-06T02:36:46Z" }