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

alexa fitbit skill

Hi - did any one of you worked with the option of Accountlinked and linked your custom skill with Alexa for fitbit ? 

 

If So , I am having issues with my client id and authorization process . Can somebody be able to help me in there . 

Best Answer
0 Votes
10 REPLIES 10

                                   

I have registered my application and got 

 

OAuth 2.0 Client ID
227YT5
Client Secret
Moderator edit: REMOVED. Please do not post your client secret anywhere publicly. Please reset it immediately by going to https://dev.fitbit.com/apps .
OAuth 2.0: Authorization URI
https://www.fitbit.com/oauth2/authorize
OAuth 2.0: Access/Refresh Token Request URI
https://api.fitbit.com/oauth2/token
 
and with from Alexa - using the redirect urls:
but it is failing .
https://www.fitbit.com/oauth2/authorize?prompt=consent&redirect_uri=https%3A%2F%2Fpitangui.amazon.co...227YT5&response_type=code&scope=activity+heartrate+nutrition+profile+settings+sleep+social+weight
I am not able to find any options in here , Can somebody be able to please help me . 
 
Thanks a lot for all your help.
Priya
Best Answer
0 Votes

What is the error you're seeing? What is the URL being requested and what is being returned?

Best Answer
0 Votes

 

Sorry,when I am using response_type=token and I am getting : 

 

https://www.fitbit.com/oauth2/authorize?%20prompt=consent&&client_id=227YT5&redirect_uri=https://pit...

 

Developer information: invalid_request - Invalid redirect_uri parameter value

 

Thanks,

Priya

 

Best Answer
0 Votes

This means that the value specified for redirect_uri does not match the value specified in your app settings on https://dev.fitbit.com/apps . More information about redirect URIs is at https://dev.fitbit.com/docs/oauth2/#redirect-uris .

Best Answer
0 Votes

                                   

Thank you . Now when I corrected that  and used this link , it is taking me to the Authorization page and when I select Accept - it is taking me to the other page where - I am seeing this .Not sure if this is correct .

{"message":null}

 

https://www.fitbit.com/oauth2/authorize?%20prompt=consent&&client_id=227YT5&redirect_uri=https://pit...

Best Answer
0 Votes

                                   

Thank you . Now when I corrected that  and used this link , it is taking me to the Authorization page and when I select Accept - it is taking me to the other page where - I am seeing this .Not sure if this is correct . Not sure if I am on the right path . 

{"message":null}

 

https://www.fitbit.com/oauth2/authorize?%20prompt=consent&&client_id=227YT5&redirect_uri=https://pit...

Best Answer
0 Votes

@priya.madala What you'll need is the access token in the URL once you've redirected to that page. It should look like this:

https://pitangui.amazon.com/api/skill/link/M8R8A9SNH1Q89#access_token=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzQ0tORkwiLCJhdWQiOiIyMjdZVDUiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJyc29jIHJzZXQgcmFjdCBybG9jIHJ3ZWkgcmhyIHJudXQgcnBybyByc2xlIiwiZXhwIjoxNDgxNjQ1MDAzLCJpYXQiOjE0ODEwNDAzOTd9.IodZ_qt0jc3DRQjpVwheMw0XqtXDuPxdeSFuszSY5VA&user_id=3CKNFL&scope=sleep+settings+nutrition+activity+social+heartrate+profile+weight+location&token_type=Bearer&expires_in=604606

 

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

                                   

 

Hi thanks a lot for the quick response . 

So I made a little progress and now couple of issues :

first one :  

in the application settings the callback url : 

 https://pitangui.amazon.com/spa/skill/account-linking-status.html?vendorId=M8R8A9SNH1Q89

and i have this link : 

with implicit grant : 

https://www.fitbit.com/oauth2/authorize?response_type=token&client_id=227YT5&redirect_uri=https://pi...

 

but it is always going to a page :

https://pitangui.amazon.com/spa/skill/account-linking-status.html?success=false using Implicit grant , it is saying unable to link your skill , please try again later .

 

second issue :

 

And now when I am trying the api call : I used clientid in the userid , 

https://api.fitbit.com/1/user/227YT5/body/log/fat/date/2016-12-06.json

 

But I am unable to do the get. Not sure where i am missing . Any ideas for me . 

I would really appreciate all your time . 

Thanks for all your help.

 

 

Best Answer
0 Votes

@priya.madala wrote:

 

but it is always going to a page :

https://pitangui.amazon.com/spa/skill/account-linking-status.html?success=false using Implicit grant , it is saying unable to link your skill , please try again later .

 


@priya.madala It looks like you're trying to chain two OAuth flows together. I'd suggest contacting Amazon about the error you're seeing.

 


priya.madala wrote:

And now when I am trying the api call : I used clientid in the userid , 

https://api.fitbit.com/1/user/227YT5/body/log/fat/date/2016-12-06.json


@priya.madala You need to use the user id when making calls, not the client id.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

                                  

 

Sure , thanks a lot . I really appreciate your timely quickly response .I am currently checking with Alexa.

 

1.But may i know the ceertification type that's used by fitbit . Because Alexa has some restrictions it seems .

2.And is there specific domain information related to fitbit - that needs to be referred

3.As I know my userid , are there any apis that I can invoke using them without Authentication ?Because in the documentaion it did not specified it requires authentication , so I was trying this api method to invoke .But I am not seeing the response returned .

https://api.fitbit.com/1/user/-/activities/steps/date/today/1m.json

 

so Just wondering are there any stright apis supported by fitbit without authentication required .

Thanks a bunch!

 

 

 

 

Best Answer
0 Votes