04-16-2016 07:26 - edited 04-16-2016 07:29
04-16-2016 07:26 - edited 04-16-2016 07:29
**DISREGARD THIS QUESTION, the api is returning kilometers**
Here is my dashboard from 4/15, showing 11,711 total steps and 5.76 total miles. The API for the same day shows the same number of steps:
[steps] => 11711
but the total miles are way inflated:
[distances] => Array
(
[0] => Array
(
[activity] => total
[distance] => 9.26
)
[1] => Array
(
[activity] => tracker
[distance] => 9.26
)
Any thoughts on why this is??
Thanks, Len
04-16-2016 11:09
04-16-2016 11:09
@ljhardy Glad you figured it out.
If you want the API to return distance in miles, you'll have to include the Accept-Language header and set it to 'en_US'.
04-16-2016 13:56
04-16-2016 13:56
Thanks Andrew - I'm sure this should be easy, but I'm struggling a little bit with it. Do I set this header when I authenticate, or when I request the data?
Thanks, Len
04-16-2016 14:23
04-16-2016 14:23
@ljhardy Depending on the programming language or framework you're using, you should consult their documentation for adding HTTP headers.