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

Some question about migrate OAuth 1.0 to 2.0 and access to API

ANSWERED

Almost user in our system linked to Fitbit but we hope to upgrade 1.0 to 2.0. In step refresh_token it works and we got these from your API.

 

{
	"access_token":"<< access token >>",
	"expires_in":3600,
	"refresh_token":"<< refresh token >>",
	"scope":"weight settings profile social activity nutrition sleep",
	"token_type":"Bearer",
	"user_id":"<< user id >>"
}

and when we tried to access some feature in your API (ex. GetDevice ) it doesn't work and the system return these message to us.

 

{
	"errors":[
		{
			"errorType":"invalid_client",
			"message":"Incorrect OAuth version. Found OAuth V1.0. 
			Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API 
			authorization process."
		}],
	"success":false
}

Could you have any idea for call API after we upgrade OAuth token key ? 

 

Before we tried to get your information from API we make a request like these.

 

GET https://api.fitbit.com/1/user/-/profile.json
Authorization: Bearer { access_token }
Refreshing Tokens

Thank you.

 

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Are you using the OAuth 1.0 PHP library or an OAuth 2 provider? It looks like you're using the OAuth 1.0 PHP library, looking from the outside, unless the API throws that error for something else, like a malformed header.

View best answer in original post

Best Answer
3 REPLIES 3

It sounds like you're not sending the Authorization header that you think you are. Can you log the raw HTTP response? You might try Runscope Request Capture.

Best Answer
0 Votes

Are you using the OAuth 1.0 PHP library or an OAuth 2 provider? It looks like you're using the OAuth 1.0 PHP library, looking from the outside, unless the API throws that error for something else, like a malformed header.

Best Answer

we 're missing some one when i tried to load constructor if the system started it calls OAuthentication 1.0.

 

Thank you for suggest 🙂 

Best Answer
0 Votes