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

WebApi steps... nothing returned.

ANSWERED

Hi,

I've been playing around with an app to interrogate my past history using the web api.

It works well and easily for activities/heart body/weight and body/fat so I am confident that the code works and is good. (And, as the starting point for the code came from @Gondwana , I am confident that it has a reasonable pedigree.)

 

If I attempt to use the same process with activities/steps or tracker/steps I get nada, bupkiss and zilch.

 

There is literally no data returned, I get no errors, just an empty response.

 

There is nothing in the documentation here https://dev.fitbit.com/build/reference/web-api/activity/ that gives me any clues. As far as I can tell, I am doing exactly the same thing, using correctly formatted dates with correctly formatted URLs and (just to be sure) I have given myself every permission I can find.

 

Do these APIs still work? 

Is the documentation correct?

Can I get my personal, historic, step data via the webapi?

 

Thanks,

G

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Ok, in another forum, I got some help on this. Properties were not enumerable for JSON.stringify() so I used this to read response.text() instead:

[code]

async function debugLog(forThis) {
  let tttt = await forThis.text(); 
  console.log(tttt);
}
[/code]
And saw the problem is the scope of my OAUTH app.
 

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

As an update to this:

I've tested the URL with the OAUTH2.0 tutorial page and CURL and it works outside of the app... https://api.fitbit.com/1/user/-/activities/heart/date/2020-01-01/2020-04-30.json but inside the app, I get nothing.

 

Is there a restriction on using this API on a device?

 

Best Answer
0 Votes

Ok, in another forum, I got some help on this. Properties were not enumerable for JSON.stringify() so I used this to read response.text() instead:

[code]

async function debugLog(forThis) {
  let tttt = await forThis.text(); 
  console.log(tttt);
}
[/code]
And saw the problem is the scope of my OAUTH app.
 
Best Answer
0 Votes