Vitals
Caffeine
Vitals
Caffeine
Get timeseries data for user
GET
/v2/timeseries/{user_id}/caffeine
x-vital-api-key*
curl --request GET \
--url https://api.tryvital.io/v2/timeseries/{user_id}/caffeine \
--header 'x-vital-api-key: <x-vital-api-key>'
curl --request GET \
--url {{BASE_URL}}/v2/timeseries/{user_id}/caffeine?start_date={{START_DATE}}&end_date={{END_DATE}} \
--header 'Accept: application/json' \
--header 'x-vital-api-key: <API_KEY>'
[
{
"id": null,
"timestamp": "2022-04-20T13:02:01.123771+00:00",
"value": 42,
"type": "automatic",
"unit": "g"
}
]
​Path Parameters
user_idrequired
string
User id returned by vital create user id request. This id should be stored in your database against the user and used for all interactions with the vital api.
​Query Parameters
resourcerequired
string
The REST API name of timeseries resources Should match vital_core.ee.schemas.webhook.WebhookType unless there is a strong reason not to.
providerDefault: ""
string
Provider oura/strava etc
start_daterequired
string
Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00
end_date
string
Date to YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 23:59:59
​Response
ClientFacingCaffeineTimeseries
array
curl --request GET \
--url {{BASE_URL}}/v2/timeseries/{user_id}/caffeine?start_date={{START_DATE}}&end_date={{END_DATE}} \
--header 'Accept: application/json' \
--header 'x-vital-api-key: <API_KEY>'
[
{
"id": null,
"timestamp": "2022-04-20T13:02:01.123771+00:00",
"value": 42,
"type": "automatic",
"unit": "g"
}
]