cURL
curl --request GET \
--url https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices \
--header 'Authorization: Bearer <token>'import requests
url = "https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 1,
"name": "Fitbit",
"slug": "fitbit",
"logoUrl": "https://picsum.photos/200/300",
"status": "connected",
"type": "watch",
"sleep": [
{
"name": "REM Sleep",
"unit": "hours",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"value": 2.5
}
],
"average": 2.5,
"percentChange": 15.2
}
],
"activity": [
{
"name": "Daily Active Calorie Burn",
"unit": "Calories",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"value": 789
}
],
"average": 456,
"percentChange": 15.2
}
],
"body": [
{
"name": "Weight",
"unit": "lbs",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"value": 150
}
],
"average": 150,
"percentChange": 15.2
}
],
"bloodPressure": {
"name": "Blood Pressure",
"unit": "mmHg",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"systolic": 120,
"diastolic": 80
}
],
"average": {
"systolic": 120,
"diastolic": 80
},
"abnormalInstancePercentage": 0,
"percentChange": 0
},
"activityHeartRate": {
"name": "Heart Rate",
"unit": "bpm",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"averageHeartRate": 80,
"maximumHeartRate": 200,
"minimumHeartRate": 55,
"restingHeartRate": 60
}
],
"average": 80,
"abnormalInstances": 0,
"percentChange": 0
}
}
],
"vitalConnectedDevices": [
{
"id": 1,
"name": "Fitbit",
"slug": "fitbit",
"logoUrl": "https://picsum.photos/200/300",
"status": "connected",
"type": "watch"
}
]
}{
"message": "Patient not found"
}{
"message": "User does not have any connected devices"
}Patient
Get Device Data
Returns device data and connected devices for a patient
GET
/
patient
/
{patientId}
/
devices
cURL
curl --request GET \
--url https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices \
--header 'Authorization: Bearer <token>'import requests
url = "https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://om-staging.mylifeforce.com/api/m2m/patient/{patientId}/devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 1,
"name": "Fitbit",
"slug": "fitbit",
"logoUrl": "https://picsum.photos/200/300",
"status": "connected",
"type": "watch",
"sleep": [
{
"name": "REM Sleep",
"unit": "hours",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"value": 2.5
}
],
"average": 2.5,
"percentChange": 15.2
}
],
"activity": [
{
"name": "Daily Active Calorie Burn",
"unit": "Calories",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"value": 789
}
],
"average": 456,
"percentChange": 15.2
}
],
"body": [
{
"name": "Weight",
"unit": "lbs",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"value": 150
}
],
"average": 150,
"percentChange": 15.2
}
],
"bloodPressure": {
"name": "Blood Pressure",
"unit": "mmHg",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"systolic": 120,
"diastolic": 80
}
],
"average": {
"systolic": 120,
"diastolic": 80
},
"abnormalInstancePercentage": 0,
"percentChange": 0
},
"activityHeartRate": {
"name": "Heart Rate",
"unit": "bpm",
"data": [
{
"date": "2022-04-18T00:00:00Z",
"averageHeartRate": 80,
"maximumHeartRate": 200,
"minimumHeartRate": 55,
"restingHeartRate": 60
}
],
"average": 80,
"abnormalInstances": 0,
"percentChange": 0
}
}
],
"vitalConnectedDevices": [
{
"id": 1,
"name": "Fitbit",
"slug": "fitbit",
"logoUrl": "https://picsum.photos/200/300",
"status": "connected",
"type": "watch"
}
]
}{
"message": "Patient not found"
}{
"message": "User does not have any connected devices"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The id of the patient in question A universally unique identifier.
Example:
"29ea9012-c622-4851-a57a-9327abd21198"
Query Parameters
Time range for the device data
Available options:
last7, last90, last180 ⌘I