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

Why occur error Invalid authorization token type?

ANSWERED
I confirm oauth2 by url:
https://www.fitbit.com/oauth2/authorize?response_type=code&prompt=consent&client_id=22CNHL&redirect_uri=myapp%3A%2F%2localhost&scope=activity

I had get code from url callback:
code = intent.data.getQueryParameter("code") // value of code ="040499f5bff449...d9f04c7a0da58ecb3"

I using this url get token:
var url = "https://api.fitbit.com/oauth2/token

Result I have 2 value:
accesstoken=json.getString("access_token")
refesh_token=json.getString("refresh_token")

I refresh token by url:
var url = "https://api.fitbit.com/oauth2/token?grant_type=refresh_token&refresh_token=" + refesh_token

Result I have a user_id:
user_id=json.getString("user_id")

I use user_id to access data by url:
var url="https://api.fitbit.com/1/user/"+user_id+"/activities/date/2018-03-10.json"
But it occur error:

{"errors":[{"errorType":"system","fieldName":"n/a","message":"Authorization Error: Invalid authorization token type"}],"success":false}

Why? What is token type?
Thank you.

 

Best Answer
1 BEST ANSWER

Accepted Solutions

the cause: i not set access token to header.

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

the cause: i not set access token to header.

Best Answer
0 Votes