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

Activity Steps Web API is not working

Hello I'm trying to get steps activities using the following API 

 

API: https://api.fitbit.com/1/user/-/activities/steps/date/2020-10-20/1d/15min/time/08:00/20:00.json

 

but getting the "insufficient_permissions" in response with a message "API client is not authorized by Fitbit to access the resource requested."

 
let url = `https://api.fitbit.com/1/user/-/activities/steps/date/${'date'}/1d/15min/time/08:00/20:00.json`;

fetch(url, {
      method: 'GET',
      headers: {
      Authorization: `Bearer ${access_token}`,
      },
})
.then((res) => res.json())
.then((res) => {
        console.log('.............res', res);
})
.catch((err) => {
        console.log('............warn:', err);
});
Best Answer
0 Votes
1 REPLY 1

Hi @soken 

 

The endpoint your executing is an intraday endpoint.  You should be able to query this data if the access token belongs to the Fitbit account which owns the application and the application type = "personal".  If you're trying to query someone else's intraday data, then you'll need to request access at https://dev.fitbit.com/build/reference/web-api/intraday-requests/.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes