06-26-2020 11:03
06-26-2020 11:03
Hi there,
Our application will request the activities using en_GB in the header, which returns the following values as part of the response.
Looking at this data, the `distance` is in fact returned in km after checking the fitbit activity that matches this one, but the `distanceUnit` shows "Mile".
```
"activityName": "Walk",
"activityTypeId": 90013,
"averageHeartRate": 108,
"calories": 86,
"distance": 0.859961,
"distanceUnit": "Mile",
```
Is this expected?
We were using the `distanceUnit` to ensure we calculated our distance correctly assuming this would have come back matching the `distance`, but maybe that was an incorrect assumption to the `distanceUnit`'s intended purpose in this case?
06-29-2020 10:01
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
06-29-2020 10:01
Would you please confirm what endpoint you're using?
Thanks!
Gordon
Best Answer06-29-2020 10:39 - edited 06-29-2020 10:51
06-29-2020 10:39 - edited 06-29-2020 10:51
Sure thing Gordon. I was just about to test out whether or not this changes if I update my settings to use km whether or not this affects this return value.
Headers being sent are {"Authorization"=>"Bearer xxxx", "Accept-Language"=>"en_GB"}
Best Answer06-29-2020 11:19
06-29-2020 11:19
Just as a note, I changed my setting to be km on my device and the results are the same. I am getting the distance in km and the distanceUnit returns "Mile" still.
06-29-2020 13:51
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
06-29-2020 13:51
@frank.west.iii Thank you for the additional testing and information. Let me do some research on my end and get back with you.
Best Answer01-18-2022 02:33
01-18-2022 02:33
Hi @Gordon-C - If someone configures their distance settings in their profile, does that take precedence? Here's an example scenario:
I'm in the US but I set my profile to use km
My research team pulls my data using the default localization (en_US)
Does the data return in km (because the profile's settings take precedence) or does the data get converted into miles (so the localization of the API pull takes precedence)?
Thanks!
Best Answer