Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Webhook Sleep Data Notification Date Issues with Timezone

I'm a developer from Japan working with the Fitbit Web API to receive sleep data update notifications via webhooks.
I'm experiencing timezone-related issues and would appreciate any advice from the community.

Issue Description:

Case 1 (Date shows as previous day):

  • Sleep time: July 9th 00:30 - 06:30 (Japan Standard Time, UTC+9)
  • Webhook notification: Sleep data for July 8th updated
  • Result: Querying July 8th data → No data found, Querying July 9th data → Data exists

Case 2 (Working correctly):

  • Sleep time: July 14th 00:30 - 09:30 (Japan Standard Time, UTC+9)
  • Webhook notification: Sleep data for July 14th updated
  • Result: Querying July 14th data → Data retrieved successfully

Environment:

  • Fitbit device: Inspire2, Timezone set to Tokyo/Asia
  • Location: Japan (UTC+9)

Observed:

  1. Webhook notification dates appear to be calculated based on UTC
  2. This issue doesn't occur with manually entered sleep data

Question:
What is the recommended approach to correctly interpret dates received from webhooks and query data using the appropriate date?

Any insights would be greatly appreciated!

Best Answer
0 Votes
1 REPLY 1

Hi @h-irie 

The notification date tells you when the sleep record has been added, updated or deleted.   Unfortunately, we do not state in the notification which action occurred.  If the user deleted a sleep record on July 8th, that would make sense for case 1.

  • Can you confirm if the user previously has a sleep record on July 8th?
  • If you query the sleep record on July 9th for this user using the Get Sleep Log List endpoint, is the logType value auto-detected or manual?
  • Can you find out what mobile device (android or iOS) the user has the Fitbit app installed?

Gordon

Best Answer
0 Votes