02-25-2015 15:21
02-25-2015 15:21
Most of the time Fitbit login works just fine on our site. It has been in production for a year so no major concerns except occasionaly we get the below error messages.
Are these cause for concern?
'''
[25-Feb-2015 22:46:49 UTC] PHP Fatal error: Uncaught exception 'OAuthException' with message 'Invalid auth/bad request (got a 401, expected HTTP/1.1 20X or a redirect)' in /home/sprout/public_html/sprout/application/libraries/Sprout_fitbit.php:88
Stack trace:
#0 /home/sprout/public_html/sprout/application/libraries/Sprout_fitbit.php(88): OAuth->getAccessToken('https://api.fit...', '1', 'sarlu8iqf91fe04...')
#1 /home/sprout/public_html/sprout/application/controllers/external_services.php(239): Sprout_fitbit->initSession('https://mckinse...')
#2 [internal function]: External_Services->fitbit_login()
#3 /home/sprout/public_html/sprout/application/core/MY_Controller.php(245): call_user_func_array(Array, Array)
#4 /home/sprout/public_html/sprout/codeigniter/system_2_0_2/core/CodeIgniter.php(305): MY_Controller->_remap('fitbit_login', Array)
#5 /home/sprout/public_html/sprout/index.php(226): require_once('/home/sprout/pu...')
#6 {main}
thrown in /home/sprout/public_html/sprout/application/libraries/Sprout_fitbit.php on line 88
```
Best Answer02-25-2015 16:29
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.
02-25-2015 16:29
We can't debug your application code. Can you please provide the HTTP request and response?
Specifically, knowing the body response from the 401 would likely detail the issue.
Best Answer02-27-2015 20:38
02-27-2015 20:38
Hi and thanks very much for your fast response.
I have been using https://github.com/heyitspavel/fitbitphp so I wondered if it is a common issue.
I have made a change to the code which will store the response if there is an exception.
Currently I am waiting for this to go into production, once I have some useful responses I will get back to you.
thankyou
Best Answer11-06-2015 09:37
11-06-2015 09:37
Hey I am getting the same error how did you resolve this.
Best Answer