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

Erroneous error message? "API client is not authorized by the resource owner to access the resource"

Hi devs,

 

Reposting here because I've yet to receive a reply.

 

Am creating a code to collect sleep data from multiple devices. So far I've been able to get the data from the devices individually but when I start using for loops to get data from multiple devices, I receive an error "API client is not authorized by the resource owner to access the resource requested".

 

It doesn't make sense to me because it appears very randomly - e.g. if I try to get data from Users 1, 2 & 3, occasionally the error will pop up for 1 & 2 but be successful for 3, then on the subsequent trial (without changing my code) the error pops up for 2 & 3 but 1 is successful.

 

I'm very certain that the resource owner has allowed access to the resource since I can extract the data from the device on an individual basis. Was wondering how I should go about solving this? Is it an intrinsic problem with my code? Thanks!

Best Answer
1 REPLY 1

Hi @fullofissues 

 

If you're able to pull the data individually, then it should not be a permissions problem.   Do you have a way to verify your code is using the correct access token for each user within the loop?   Our logs would not show this information so I cannot confirm on our side except that a 403 error occurred.  I'm thinking it might be a timing issue.

 

Gordon

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