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

Legacy Fitbit Web API rejects valid 7-character user IDs returned by profile endpoint

We are seeing an inconsistency in the legacy Fitbit Web API for newly created users.

Calling:
GET /1/user/-/profile.json

returns an encodedId such as:
98AV5X7

But calling:
GET /1/user/98AV5X7/body/log/weight/date/YYYY-MM-DD.json  (date was anonymized as it was not possible to submit this message with real date)

returns HTTP 400 with:
"Violation in GetWeightLogRequest.user_id - User id field must contain a hyphen or exactly 6 uppercase letters or digits."

This appears to mean:

the profile endpoint returns a 7-character user ID
some legacy endpoints still validate user_id using the old 6-character rule

This seems to affect newly created users. Can you confirm whether this is a known issue and whether explicit user IDs should no longer be used for these legacy endpoints in favor of /user/-/ ?

Thank you,
HealthReact team

Best Answer
0 Votes
5 REPLIES 5

Hi @HealthReact 

Thanks for reaching out. 

For all requests where you are calling data for the currently authenticated user, can you please try using the hyphen shortand (-) in the URL path instead of the explicit encodedId and see if it works for you? For example: Get /1/user/-/body/log/weight/date/[date].json

 

Best Answer
0 Votes

@DorisL Isn't there any update regarding this issue? We're getting this error as well in our service.

Best Answer
0 Votes

Thank you for your advice. It worked.

All new users have now again 6-character user IDs over the past week. Is there a plan to introduce 7-character user IDs in the near future?

Best Answer
0 Votes

Hi @amirrez 

Have you tried using the hyphen shortand (-) in the URL path instead of the explicit encodedId? (please see my previes commet). Let me know if the issues are still persisting on your end. 

Best Answer
0 Votes

Hi @HealthReact 

There is currently no plan to introduce a 7-character user ID format for the legacy system. Moving forward, we are transitioning to the Google Health User ID (healthUserId). We recommend planning your future integrations around the Google Health API to utilize this new, more flexible ID structure. 

Best Answer
0 Votes