Releasesv0.1.0
Api referenceEndpointsExports

One list of the user as a CSV or Parquet file

GET
/v1/users/{id}/exports/{dataset}

Every record of one list in [start, end), as one file streamed in a single response (Content-Disposition: attachment). The columns are the members of the list's JSON records, in the same order and with the same names and values: times in UTC, a missing value empty (CSV) or null (Parquet), metadata (and the daily sources) as JSON text. samples holds every quantity type unless type names one. The file is not paged: cursor and limit are a 400. A failure once the file has started cuts the connection, so a truncated file never looks complete. See docs/exports.md.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
Formatuuid
dataset*string

The list to export. Another name is a 404.

Value in"samples""category-samples""sleep""workouts""nutrition""daily"

Query Parameters

format?string

csv (the default) or parquet.

Default"csv"
Value in"csv""parquet"
type?string

The canonical type to keep, for the lists that have one (samples, category-samples, workouts).

start?|

Inclusive lower bound, RFC 3339 or YYYY-MM-DD.

end?|

Exclusive upper bound, RFC 3339 or YYYY-MM-DD. Must not be before start.

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Response Body

The file.

response?string
curl -X GET 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/exports/samples' \  -H 'Authorization: Bearer ohs_sk_...'
"string"
Edit on GitHub