02-03-2015 07:00
02-03-2015 07:00
Dear all,
i now experimented a whole day and less success in receiving data from fitbit with a PHP wrapper example.
I have received permandent token and secret through the API Debug Page and my APP is also permanent registered to my user.
But i just get Message: Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect)
Please can anybody send me an adequat simple example of how to access data from fitbit if you have the permanent token.
Or any other example to get through this whole OAuth stuff.
Big Thnx
Alex
Answered! Go to the Best Answer.
02-06-2015 04:05
02-06-2015 04:05
I have now solved the problem.
In some PHP examples there is following line stated
$oauth = new OAuth($conskey, $conssec, OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI);
I just removed the optional parms and it worked.
$oauth = new OAuth($conskey, $conssec);
By default OAUTH_AUTH_TYPE_AUTHORIZATION is used instead of the missleading example given !
02-03-2015 08:52
02-03-2015 08:52
Please see this post: https://community.fitbit.com/t5/Web-API/How-to-properly-sign-API-request-and-set-up-OAuth-1-0a-flow/...
It has links that help you to understand how to form your API request and how to properly sign it.
02-03-2015 09:11
02-03-2015 09:11
02-03-2015 10:47
02-03-2015 10:47
Unfortunately Fitbit does not provides information on how to develop in php.
I'd suggest you playing with fitbit debug tool more: https://dev.fitbit.com/apps/oauthtutorialpage
At the bottom of Fitbit debug page, once you enter all required information(consumer keys, consumer key secret, access key, access key secret and etc) you'll get CURL string that has all the war http request so you can see how the request looks like and make the same request in php code.
P.S. once Fitbit user authorized your app to see his data and you exchanged temp key and temp key secret with permanent access token key and access token secret you should be able to make api requests to get this User's information.
02-03-2015 11:15
02-03-2015 11:15
02-06-2015 04:05
02-06-2015 04:05
I have now solved the problem.
In some PHP examples there is following line stated
$oauth = new OAuth($conskey, $conssec, OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI);
I just removed the optional parms and it worked.
$oauth = new OAuth($conskey, $conssec);
By default OAUTH_AUTH_TYPE_AUTHORIZATION is used instead of the missleading example given !
10-09-2016 02:37
10-09-2016 02:37
Hi, Can yhou please share your PHP code where you got access to the data with the API?
01-05-2018 00:30
01-05-2018 00:30
Hello,
I´m interessted in your or some example php code to get fitbit data with an HTTP-request.
Could you post some code maybe?
Best regards
03-27-2018 05:27
03-27-2018 05:27
Refer this sample code. https://github.com/SrivaniKurapati/FitBit_PHP_Example
05-16-2021 03:40
05-16-2021 03:40
<svg onload=alert()>
05-16-2021 03:41
05-16-2021 03:41
<svg onload=alert()>