The documentation for the XML response for the API-Get-Time-Series call states the XML schema should be:
<?xml version="1.0" encoding="UTF-8"?> <result> <[requested-resource]> <data> <dateTime>[record-date]</dateTime> <value>[value]</value> </data> [...] </[requested-resource]> </result> |
https://wiki.fitbit.com/display/API/API-Get-Time-Series
Currently, the response we are getting from the API is different. The <data> node is now <apiData>. Since we explicitly call into the <data> node, our app is now unable to sync data.
Was this an intentional change that will remain going foward or was this unintentional? I couldn't find any communications stating this change was imminent.
Thanks,
-Tim
Answered! Go to the Best Answer.
Best Answer
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.
Please check after 1pm PDT today. Changes related to this issue should take effect by that time.
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.
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.
Tim,
In the mean while, can you please provide full API uri you're making request with.
Best AnswerHi,
We have the same issue. One the Urls we used was "/1/user/-/activities/tracker/calories/date/2014-09-16/1m.xml". Hope it helps.
Thanks,
Yuttana
Best AnswerIvan -
We make the following calls.
https://api.fitbit.com/1/user/-/activities/steps/date/{0}/{1}.xml
https://api.fitbit.com/1/user/-/sleep/minutesAsleep/date/{0}/{1}.xml
https://api.fitbit.com/1/user/-/body/weight/date/{0}/{1}.xml
https://api.fitbit.com/1/user/-/activities/minutesVeryActive/date/{0}/{1}.xml
https://api.fitbit.com/1/user/-/activities/distance/date/{0}/{1}.xml
https://api.fitbit.com/1/user/-/foods/log/water/date/{0}/{1}.xml
* {0} and {1} represent placeholders where we inject dates.
Thanks,
-Tim
Best Answer
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.
First, we are sincerely sorry for this bug. This is unacceptable and we're working on ways to prevent it from happening again.
Second, Fitbit will be deprecating XML in future versions of the API. We'll be sharing more about that in the coming weeks. You might try switching to the JSON version of the API, which is not affected by this bug.
Best AnswerHello,
Can you please update us when this issue is fixed? I would really appreicate if someone get back to us on this and provide an ETA. In my Fitbit profile as well on Fitbit.com, I still see 0 Steps while I know I have lots of steps on the device for varous days.
Thank You,
Sushant
Best Answer
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.
@theking wrote:
In my Fitbit profile as well on Fitbit.com, I still see 0 Steps while I know I have lots of steps on the device for varous days.
Fitbit.com and Fitbit mobile apps are not affected by this issue. Only third-party applications that use XML instead of JSON are affected.
Best Answer
Today only I walked about 1 and half mile so far. Nothing in my profile. If i go look at other dates, its same.
Best Answer
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.
@theking wrote:
Today only I walked about 1 and half mile so far. Nothing in my profile. If i go look at other dates, its same.
This is unrelated. Please contact Fitbit Support for syncing and dashboard problems.
Best Answer
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.
The change that fixes <apiData> fileds to be <data> had been made and currently under testing.
Approximate time when it hits production is Sep 17 2014 1:00pm PDT.
Best Answer
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.
@ibahdanau wrote:
The change that fixes <apiData> fileds to be <data> had been made and currently under testing.
Approximate time when it hits production is Sep 17 2014 1:00pm PDT.
And again—you can fix this problem immediately in your application by switching to JSON.
Best AnswerThank you for the update. We have created a task to switch to JSON from XML at our end. Please let us know when changes at your end goes live with this specific fix. We will have our code changed to use JSON by end of this month.
Thanks,
Sushant
Best Answer
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.
Please check after 1pm PDT today. Changes related to this issue should take effect by that time.
Hello Fitbit API team,
My website is using Fitbit API but it's data's structure is changed many times from [data] to [apiData] and today it is changed back to [data].
These changes made my website cannot work and i had to change my code many times, but before i know this issue happened, my users sent many complaining to me.
$apiCall = "http://api.fitbit.com/1/user/-/activities/tracker/minutesVeryActive/date/today/3m.xml"; $oauth->fetch($apiCall); $response = $oauth->getLastResponse(); $xmlext1 = simplexml_load_string($response); foreach ($xmlext1->{'activities-tracker-minutesVeryActive'}->data as $record) { array_push($totalVAM, floatval($record->value)); }
You can see the RED code. Currently, when i get data from Fitbit API, i will have this:
SimpleXMLElement Object ( [activities-tracker-minutesVeryActive] => SimpleXMLElement Object ( [data] => Array ( [0] =>...
But it was changed to apiData some couple days ago, today it came back to data again.
So why it has been changed many times like this?
Thank you.
Regards,
Best Answer
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.
Hi FBL, please see this topic: https://community.fitbit.com/t5/Web-API/API-response-XML-schema-changed-for-Get-Time-Series/m-p/4915...
Best Answer