Я пытаюсь получить данные, используя следующую ссылку: — https://dev.fitbit.com/docs/activity/ и API: — GET https://api.fitbit.com/1/user/[user-id]/activities/date/[date].json
и получить массив ответов, как показано ниже
Array(
[result] => Array
(
[activities] => Array
(
[0] => Array
(
[activityId] => 90013
[activityParentId] => 90013
[activityParentName] => Walk
[calories] => 25
[description] => Walking less than 2 mph, strolling very slowly
[distance] => 0.271426
[duration] => 355000
[hasStartTime] => 1
[isFavorite] =>
[lastModified] => 2016-11-29T19:11:42.000Z
[logId] => 5007419020
[name] => Walk
[startDate] => 2016-11-30
[startTime] => 00:34
[steps] => 342
)
)
[goals] => Array
(
[activeMinutes] => 30
[caloriesOut] => 2157
[distance] => 8.05
[floors] => 10
[steps] => 10000
)
[summary] => Array
(
[activeScore] => -1
[activityCalories] => 55
[caloriesBMR] => 1257
[caloriesOut] => 1300
[distances] => Array
(
[0] => Array
(
[activity] => Walk
[distance] => 0.271426
)
[1] => Array
(
[activity] => total
[distance] => 0.48
)
[2] => Array
(
[activity] => tracker
[distance] => 0.42
)
[3] => Array
(
[activity] => loggedActivities
[distance] => 0.271426
)
[4] => Array
(
[activity] => veryActive
[distance] => 0.09
)
[5] => Array
(
[activity] => moderatelyActive
[distance] => 0.11
)
[6] => Array
(
[activity] => lightlyActive
[distance] => 0.16
)
[7] => Array
(
[activity] => sedentaryActive
[distance] => 0.12
)
)
[elevation] => 0
[fairlyActiveMinutes] => 5
[floors] => 0
[heartRateZones] => Array
(
[0] => Array
(
[caloriesOut] => 37.9099
[max] => 98
[min] => 30
[minutes] => 25
[name] => Out of Range
)
[1] => Array
(
[caloriesOut] => 33.193
[max] => 137
[min] => 98
[minutes] => 9
[name] => Fat Burn
)
[2] => Array
(
[caloriesOut] => 0
[max] => 166
[min] => 137
[minutes] => 0
[name] => Cardio
)
[3] => Array
(
[caloriesOut] => 0
[max] => 220
[min] => 166
[minutes] => 0
[name] => Peak
)
)
[lightlyActiveMinutes] => 6
[marginalCalories] => 33
[sedentaryMinutes] => 1426
[steps] => 789
[veryActiveMinutes] => 3
)
)
[code] => 200
[content_type] => application/json;charset=UTF-8
)
но проблема в том, что этот массив просто предоставляет мне данные о деятельности, которая была выполнена с использованием приложения Fitbit. Но я должен получить полные данные, будь то приложение Fitbit или устройство Fitbit, т.е.
Просто взглянув на API, я считаю, что вам нужно использовать activities/tracker/
, API утверждает, что он представляет значения ежедневной активности, зарегистрированные только устройством отслеживания, за исключением записей журнала активности вручную. Так что вам просто нужно добавить tracker
на ваш GET
,
Деятельность трекера:
activities/tracker/calories
activities/tracker/steps
activities/tracker/distance
activities/tracker/floors
activities/tracker/elevation
activities/tracker/minutesSedentary
activities/tracker/minutesLightlyActive
activities/tracker/minutesFairlyActive
activities/tracker/minutesVeryActive
activities/tracker/activityCalories
Других решений пока нет …