Devices API
Get User Data
Returns user info from all of the specified users' connected providers.
GET
/user
x-api-key*
curl --request GET \
--url https://api.sandbox.metriport.com/user \
--header 'x-api-key: <x-api-key>'
Query Params
userIdrequired
string
The Metriport user ID to create a session token for.
daterequired
string
Day for which to pull the data. Formatted YYYY-MM-DD
.
For simplicity, all queries assume the UTC timezone for the specified date
starting at 00:00 to 23:59 - unless otherwise specified by the timezoneId
parameter.
timezoneId
string
Timezone ID to use for the specified date. If not specified, the UTC timezone is used.
For example this can be valid timezones like America/Los_Angeles
or Europe/Kiev
.
Valid timezones can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
Support for this parameter is under development, and currently only supported for the Google Fit provider.
Response
user
User[]
An array of user objects for each of the user’s connected providers
import { MetriportDevicesApi } from "@metriport/api-sdk";
const metriportClient = new MetriportDevicesApi("YOUR_API_KEY");
const response = await metriportClient.getUserData("metriportUserId", "date");
[
{
"age": 27,
"city": "San Francisco",
"country": "US",
"date_of_birth": "1995-08-02",
"email": "contact@metriport.com",
"region": "CA",
"sex": "male"
}
]
curl --request GET \
--url https://api.sandbox.metriport.com/user \
--header 'x-api-key: <x-api-key>'
import { MetriportDevicesApi } from "@metriport/api-sdk";
const metriportClient = new MetriportDevicesApi("YOUR_API_KEY");
const response = await metriportClient.getUserData("metriportUserId", "date");