Releasesv0.1.0
Ingest

Upload one part of Bluetooth device values

POST
/v1/ingest/bluetooth

One gzip NDJSON part (at most 64 MiB, never truncated), one characteristic value a standard Bluetooth health device sent per line: {"at": "<RFC 3339 arrival time with offset>", "char": "2a37", "value": "<hex>", "session": "<id of the connection>", "device": {"name", "manufacturer", "model", "firmware"}, "device_user": <index>} (device and device_user optional; the line format is in docs/connectors/bluetooth.md; ohs-bridge and the Swift and Kotlin SDKs write it). The server decodes heart rate with RR intervals, blood pressure, weight, body composition, glucose, temperature and pulse oximetry; other characteristics are stored and not mapped. The part is refused with 400, and nothing is stored, when a line breaks the format; a value that does not decode is a failed record of its line only. Same headers, limits and answers as the Apple Health upload. Re-sending the same part is safe: the answer is 200 with duplicate: true. Other bytes under a (day, batch, part) already stored are a 409, and so is a part sent while this provider's data is being deleted for the user (nothing is kept; send it again once the deletion job is done). Each instance processes a bounded number of uploads at once; above it the answer is 503 with Retry-After.

Authorization

userToken upload
headerAuthorizationBearer <token>

User token, ohs_ut_ + 43 base62 characters, with the scope the route needs.

Scope: upload

Header Parameters

X-OHS-Type*"gatt"

Always gatt.

Value in"gatt"
X-OHS-Day*string

UTC day of the part's first line (the server does not check it).

Formatdate
X-OHS-Batch*string
Lengthlength <= 128
X-OHS-Part*integer
Range0 <= value <= 1000000
Authorization*string

The user token, as a bearer secret.

Request Body

body*string

Response Body

Stored (or already stored) and queued for processing.

application/json
  1. response
key*string

Raw object key.

duplicate*boolean
curl -X POST 'http://localhost:8080/v1/ingest/bluetooth' \  -H 'X-OHS-Type: gatt' \  -H 'X-OHS-Day: 2019-08-24' \  -H 'X-OHS-Batch: string' \  -H 'X-OHS-Part: 0' \  -H 'Authorization: Bearer ohs_ut_...'
{  "key": "string",  "duplicate": true}
Edit on GitHub