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

Unit and Value doesnt match in the Get Profile response

ANSWERED

Hi,

I have a question on the values and the Units returned in the API response. 

In my Get User Profile response, I am getting the weight in Kgs instead of lbs whereas the weight unit is en_US.Same is for height, I am getting height in cms instead of inches. I am following the Unit Conversion documentation , as per the documentation if the Locale is en_US then the weight should be in lbs and height in inches. I guess, I am getting the values in Metric system. But the locale is en_US. Here is the example snippet.

    weight = "56.2";

    weightUnit = "en_US";

    height = "157.5";

    heightUnit = "en_US";

    locale = "en_US";

Is there something I am missing?

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@ektay I can see why that can be confusing.

 

weightUnit refers to what the units are set to on the user's profile. Setting the Accept-Language won't change the weightUnit, it will only change the value of "weight" (e.g. 'en_GB' should return the weight value in stones).

 

So in the settings of the user's Fitbit.com profile:

 

If 'Weight' = 'Pounds' then weightUnit = 'en_US'

If 'Weight' = 'Stones' then weightUnit = 'en_GB'

If 'Weight' = 'Kilograms' then weightUnit = 'METRIC'

 

You can ignore weightUnit if you want, it's just telling you what the user has their units set to. Hope that helps clarify.

Andrew | Community Moderator, Fitbit

What motivates you?

View best answer in original post

Best Answer
3 REPLIES 3

@ektay Yeah that means the units are set to en_US on the profile, but the API returns metric by default unless you set the Accept-Language to "en_US" in the header.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

Thanks for the response.

The unit Key Value pair is confusing. If Fitbit is sending me the value in Metric shouldn't it send the unit as METRIC? 

If I set the "en_UK" or "en_GB" in "Accept-Language" header I get the same response.

weight = "56.2";

weightUnit = "en_US";

Should I be ignoring weightUnit, HeightUnit all together? Any plans to fix this?

 

Best Answer
0 Votes

@ektay I can see why that can be confusing.

 

weightUnit refers to what the units are set to on the user's profile. Setting the Accept-Language won't change the weightUnit, it will only change the value of "weight" (e.g. 'en_GB' should return the weight value in stones).

 

So in the settings of the user's Fitbit.com profile:

 

If 'Weight' = 'Pounds' then weightUnit = 'en_US'

If 'Weight' = 'Stones' then weightUnit = 'en_GB'

If 'Weight' = 'Kilograms' then weightUnit = 'METRIC'

 

You can ignore weightUnit if you want, it's just telling you what the user has their units set to. Hope that helps clarify.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer