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

API response - XML schema changed for Get-Time-Series?

ANSWERED

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

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Please check after 1pm PDT today. Changes related to this issue should take effect by that time.

Ivan Bahdanau
Senior Software Developer at Fitbit

View best answer in original post

Best Answer
17 REPLIES 17

Hello Tim,

We're working ont fixing it right now. 

Should be fixed back to <data> soon.

 

Apologies for any inconvenience.

 

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

Ivan - 

 

Thanks for the update.  Glad to hear it's going back to <data>.

 

-Tim

Best Answer
0 Votes

Tim,

In the mean while, can you please provide full API uri you're making request with.

 

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

Our users are also facing the same issue. What is an ETA on fixing this issue? 

 

Thanks,

Sushant

Best Answer
0 Votes

Hi,

 

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 Answer
0 Votes

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 Answer
0 Votes

Hello,

   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
0 Votes

@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
0 Votes

Capture.PNG

 

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
0 Votes

@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
0 Votes

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.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

@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 Answer
0 Votes

Thank 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
0 Votes

Please check after 1pm PDT today. Changes related to this issue should take effect by that time.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer

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
0 Votes
Best Answer
0 Votes