07-23-2024 07:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-23-2024 07:13
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi There.
Starting on 7/19/2023, we started getting 401 errors for a large percentage of our requests for user data, with this error message:
{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED" } }
I am able to replicate the issue in Postman as well, where I am clearly sending the bearer token.
Example: https://api.fitbit.com/1/user/53F54D/activities/date/xxxx-xx-xx.json
Answered! Go to the Best Answer.

- Labels:
-
Subscriptions API
Accepted Solutions
08-26-2024 12:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-26-2024 12:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi @Jeff_New_Ocean and @DSGTeam
I want to let you know that we have fixed the "expired_token" error. We have reverted the error back to the syntax.
{
"success": false,
"errors": [
{
"errorType": "expired_token",
"message": "Access token expired: <access_token>. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."
}
]
}
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
07-23-2024 11:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



07-23-2024 11:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks for reporting this, @Jeff_New_Ocean
We've seen some variations of this problem but haven't found a solution yet. Let me research and get back to you.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

07-23-2024 12:05
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



07-23-2024 12:05
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I need a little more information from you.
- Does this problem happen with only this user or multiple users?
- Does it happen just with the Get Daily Activity Summary endpoint or all endpoints?
- Does the error happen every time you execute the endpoint or sporadically?
- Is the problem happening today?
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

07-23-2024 14:18 - edited 07-23-2024 14:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-23-2024 14:18 - edited 07-23-2024 14:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks @Gordon-C for getting back.
- It's happening across the user population.
- It's happening across multiple user data retrieval endpoints. I have examples on activities, sleep, and foods.
- It is sporadic. Trying to determine if it's always happening for the same users, or inconsistently. But from my Postman testing, it seems to be consistent for the same user.
- It is happening today.

07-24-2024 14:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



07-24-2024 14:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I've been able to perform some investigation on this problem and sent it to our engineering team for further investigation. I'll let you know what I find out.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

07-25-2024 06:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-25-2024 06:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks @Gordon-C ! 👍

07-25-2024 10:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-25-2024 10:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I would like an update on this as well, we are experiencing the same since 7/23.

07-25-2024 12:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



07-25-2024 12:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Our engineering team is still looking into your specific problem. We've confirmed the 401 errors are not related to the current maintenance efforts being performed. However, they did notice a spike of errors occurring 5:00 UTC every day. Are you observing the same pattern? Can you tell me if your application is doing anything specific at this time, such as running a cron job to query user data?
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

07-25-2024 12:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



07-25-2024 12:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @DSGTeam
I need a little more information from you.
- Does this problem happen with only with a single user or multiple users?
- Does it happen just with a specific endpoint or all endpoints?
- Does the error happen every time you execute the endpoint or sporadically?
- I'm assuming the answer is yes, but would you confirm if the problem is still happening today?
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

07-25-2024 13:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-25-2024 13:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Most of our users sporadically
- activities
- sporadically
- yes it is happening today.
Could this have something to do with the authentication changes you guys are making with google?

07-26-2024 06:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-26-2024 06:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@Gordon-C confirming that we are still seeing the behavior as I described above today.
Thanks
07-26-2024 07:35 - edited 07-26-2024 07:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-26-2024 07:35 - edited 07-26-2024 07:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Gordon-C I was able to reproduce this on my personal account. I did a fresh authentication yesterday and it synced fine but later in the day, it started kicking the same error. This clued me into the fact that is has to be something with tokens. Today I manually updated my tokens by calling the post on https://api.fitbit.com/oauth2/token and once i had updated tokens, I made the call to get activities and now it works again. I am assuming that it will start failing again once the token expires.
Please note, this is being done from a service that we have not made changes to in a couple years so something must have changed on the fitbit side.

07-29-2024 08:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-29-2024 08:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Gordon-C or @Jeff_New_Ocean, anything new on this? This is affecting a lot of our users and we need to get it resolved. I have not thought of any workarounds or fixes. Really could use some help.

07-29-2024 10:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-29-2024 10:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@Jeff_New_Ocean I think i figured it out. We are keying off of an error type of "expired_token". We are still getting 401 errors but the structure and message has changed.
It used to look something like
{"success":false,"errors":[{"errorType":"expired_token","message":"Access token expired: eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyMjlMTlYiLCJzdWIiOiI1M1M3UlAiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJyYWN0IHJzZXQgcnBybyIsImV4cCI6MTcyMjAzMjI4NSwiaWF0IjoxNzIyMDAzNDg1fQ.Rsh2uy-5BBTTKKY20IOxEKphMuvTMO1wiZ_nqKCqJBY. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}]}
Now it looks like
07-30-2024 05:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-01-2024 12:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-01-2024 12:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Yes...I'm confirming the behavior. I don't think the error should have changed.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

08-02-2024 09:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-02-2024 09:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi @Jeff_New_Ocean and @DSGTeam
Thank you for reporting this problem. I don't believe the error message should have changed. I have a reproducible for our engineering team and have asked them to look into the problem. I hope to have any update next week.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
08-15-2024 07:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-15-2024 07:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @Gordon-C, checking in if there was any update on this. Thanks!

08-26-2024 12:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-26-2024 12:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi @Jeff_New_Ocean and @DSGTeam
I want to let you know that we have fixed the "expired_token" error. We have reverted the error back to the syntax.
{
"success": false,
"errors": [
{
"errorType": "expired_token",
"message": "Access token expired: <access_token>. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."
}
]
}
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
08-28-2024 05:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-28-2024 05:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks @Gordon-C for this fix!

