Releasesv0.1.0
Ingest

Upload one part of a Mi Fitness data copy

POST
/v1/ingest/xiaomi

One gzip NDJSON part (at most 64 MiB, never truncated), one row of the Mi Fitness data copy per line, each a JSON object with a table and a key (the line format is in docs/connectors/xiaomi.md; ohs import mi-fitness writes it). 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*string

Export table of the lines of the part (fitness_data or sport_record).

X-OHS-Day*string
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/xiaomi' \  -H 'X-OHS-Type: fitness_data' \  -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