Releasesv0.1.0
Api referenceEndpointsAdmin

Nutrition logs (instance admin, one tenant)

GET
/v1/admin/tenants/{tenant_id}/users/{id}/nutrition

GET /v1/users/{id}/nutrition (listNutrition) for the tenant of tenant_id, read with an instance admin key: the same parameters and the same answer as the tenant's own key gets. Read only. Recorded in the caller's audit log and, actor admin, in the tenant's. See docs/admin-api.md.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

tenant_id*string

The id of a tenant; any other value is a 404.

Formatuuid
id*string
Formatuuid

Query Parameters

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.

cursor?string

The next_cursor of the previous page.

limit?integer
Range1 <= value <= 1000
Default100

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Response Body

One page, by start_date.

application/json
  1. response
data*array<>
next_cursor*|

Null on the last page.

curl -X GET 'http://localhost:8080/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/nutrition' \  -H 'Authorization: Bearer ohs_sk_...'
{  "next_cursor": "string",  "data": [    {      "provider": "string",      "source": "string",      "device": "string",      "ingested_at": "2019-08-24T14:15:22Z",      "id": 0,      "start_date": "2019-08-24T14:15:22Z",      "end_date": "2019-08-24T14:15:22Z",      "meal_type": "string",      "energy_kcal": 0,      "protein_g": 0,      "carbs_g": 0,      "fat_g": 0,      "fiber_g": 0,      "sugar_g": 0,      "sodium_mg": 0,      "nutrients": {},      "external_id": "string",      "metadata": {}    }  ]}
Edit on GitHub