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

Subscriptions Notifications 400 Error

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.json
with 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
Best Answer
0 Votes
1 REPLY 1

@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.json
with 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 ...' 

Best Answer
0 Votes