10-05-2022 21:49 - edited 10-19-2022 16:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-05-2022 21:49 - edited 10-19-2022 16:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Nice to meet you.
My name is HIRO.
Please tell me about "Web API Sleep"
When I get the API sleep it doesn't contain the 'summary' of the 'type steges'. Please tell me if you know why.
The API date for the attached image is September 22, 2021. I am using Inspire2.
There were many other APIs around the same time that didn't all have a "summary".
Answered! Go to the Best Answer.

- Labels:
-
Subscriptions API
Accepted Solutions
10-17-2022 13:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-17-2022 13:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
The daily summary information you are requesting is only available for the Get Sleep Log by Date endpoint. If a user has multiple sleep logs for the same date, then we will summarize the total daily sleep information at the bottom of the sleep log. However, when retrieving sleep log data over a date range using either the Get Sleep Log by Date Range (which you are using) or Get Sleep Log List, the daily summary information is not available.
If you examine the response for the endpoint you're calling, https://dev.fitbit.com/build/reference/web-api/sleep/get-sleep-log-by-date-range/#Response, you will see the daily summary is not included in the response description.
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
10-07-2022 06:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-07-2022 06:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi @Hirokazu
I'm confused by what you're asking. The summary information is shown by the 4 boxes you highlighted above. It also correlates with the documentation examples. Can you provide a little more information on what you expect to see?
Thanks!
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
10-11-2022 04:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-11-2022 04:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi Gordon
Thank you for your comment.
All the API (JSON) data I got did not include the sleep summary.
I want to know why. Also, have there been such cases in the past?

10-11-2022 06:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-11-2022 06:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi @Hirokazu
I'm not aware of situations where the sleep response did not return the summary values. Do you have an example? The example you posted contains the summary values.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
10-11-2022 16:55 - edited 10-19-2022 16:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-11-2022 16:55 - edited 10-19-2022 16:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi Gordon
Thank you for your comment.
It is not the summary, but the absence of the summary that should be included in the yellow section.
All of the APIs I'm getting don't have the summary highlighted in yellow.
We are investigating the reason why only that part is missing from the API.

10-11-2022 18:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-11-2022 18:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Which endpoint are you calling?
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
10-12-2022 18:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-12-2022 18:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi Gordon
Thank you for your comment.
I am connecting to this endpoint.
$url = "https://api.fitbit.com/1.2/user/{$participant->fitbit_user_id}/sleep/date/{$start_date}/{$end_date}.json";

10-17-2022 13:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



10-17-2022 13:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
The daily summary information you are requesting is only available for the Get Sleep Log by Date endpoint. If a user has multiple sleep logs for the same date, then we will summarize the total daily sleep information at the bottom of the sleep log. However, when retrieving sleep log data over a date range using either the Get Sleep Log by Date Range (which you are using) or Get Sleep Log List, the daily summary information is not available.
If you examine the response for the endpoint you're calling, https://dev.fitbit.com/build/reference/web-api/sleep/get-sleep-log-by-date-range/#Response, you will see the daily summary is not included in the response description.
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
10-18-2022 18:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-18-2022 18:02
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi Gordon
Thank you for your comment.
I will check the API again.

