07-13-2015 14:11
07-13-2015 14:11
Hello,
I am integrating Fitbit with the OAuth 2.0 API. I am currently trying to subscribe a user to notifications by doing a post in PHP:
It's always failling saying:
400 Bad request -Your browser sent an invalid request.
07-13-2015 14:15 - edited 07-13-2015 14:16
07-13-2015 14:15 - edited 07-13-2015 14:16
@TactioDev wrote:
Hello,
I am integrating Fitbit with the OAuth 2.0 API. I am currently trying to subscribe a user to notifications by doing a post in PHP:
POST https://api.fitbit.com/1/user/-/apiSubscriptions/1.jsonwith header: Authorization: Bearer myAccessToken
It's always failling saying:
400 Bad request -Your browser sent an invalid request.
Am I forgetting something here or the subscription API only works with OAuth 1.0 ?Thanks in advance,Regards,Simon
The subscriptions API works with OAuth 2.0.
Take a look at the raw body of the response, that should give you more information.
You could also try making the API call using cURL from the command line on a *nix machine:
curl -i \
-X 'POST' \
'https://api.fitbit.com/.....' \
-H 'Authorization: Bearer ...'