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
3 REPLIES 3

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