Upload one activity file (FIT, GPX or TCX)
One gzip NDJSON part (at most 64 MiB, never truncated) holding one activity file on one
line: {"type":"fit","data":"<base64 of the file>"}, type being fit, gpx or tcx
and equal to X-OHS-Type. The file is at most 20 MiB once decoded (the line format is in
docs/connectors/activity-files.md; ohs import files writes it). The part is refused
with 400, and nothing is stored, unless the file parses as an activity that starts at
most 48 hours from now: a FIT course, settings or monitoring file, a GPX route without
times or a file with a broken CRC is refused. 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.
userToken uploadAuthorizationBearer <token>User token, ohs_ut_ + 43 base62 characters, with the scope the route needs.
Scope: upload
X-OHS-Type*stringFormat of the file in the part.
"fit""gpx""tcx"X-OHS-Day*stringUTC day the activity starts (ohs import files sends it; the server does not check it).
dateX-OHS-Batch*stringohs import files sends af1- and the first 32 hex digits of the file's SHA-256.
length <= 128X-OHS-Part*integer0 <= value <= 1000000body*stringStored (or already stored) and queued for processing.
application/json- response
key*stringRaw object key.
duplicate*booleancurl -X POST 'http://localhost:8080/v1/ingest/activity-files' \ -H 'X-OHS-Type: fit' \ -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}