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

redirect Url

ANSWERED

Hi,

I am testing out the web api for a hobby project of mine where I want to extract my data to Google sheet.

I don't have a homepage or similar that I want to use but just use Google sheets and this causes me a bit of a problem since I don't have a redirect URL. I have found a few guides online, for example: https://github.com/googleworkspace/apps-script-oauth2 but when using the suggested redirect URL (https://script.google.com/macros/d/{MY SCRIPT ID}/usercallback)
I get a message that "www.fitbit.com refused to connect.".

 

So my question is: for those of you who takes the data to google sheets (seen some threads about it), what redirect url do you use?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi @Unytha 

 

I'm not familiar with the error "www.fitbit.com refused to connect".   I'm assuming that is an custom error in your code and the exact error message is being masked.   Can you provide me with the exact error you're receiving from Fitbit and what point in your authorization process it occurs?

 

Also, we provide a Google Sheets example which I have been able to get to work.   It uses the same redirect format as you are attempting to do.   You can try it out if you want.   See https://dev.fitbit.com/build/reference/web-api/developer-guide/libraries-and-sample-code/#Sample-Cod...

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

Hi @Unytha 

 

I'm not familiar with the error "www.fitbit.com refused to connect".   I'm assuming that is an custom error in your code and the exact error message is being masked.   Can you provide me with the exact error you're receiving from Fitbit and what point in your authorization process it occurs?

 

Also, we provide a Google Sheets example which I have been able to get to work.   It uses the same redirect format as you are attempting to do.   You can try it out if you want.   See https://dev.fitbit.com/build/reference/web-api/developer-guide/libraries-and-sample-code/#Sample-Cod...

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Awesome, will take a look directly!

 

Also, sorry for the confusion as to where the error happens. The "www.fitbit.com refused to connect" appears when I am at the https://dev.fitbit.com/apps/edit/[my userId] and tries to save the change with the https://script.google.com... as a redirect Url. With that said, will take a look on the documentation you linked and will come back with if it works and if so mark your answer as best answer.

Best Answer
0 Votes

Update: so I just tried the script in the documentation and it worked as a charm and the refuse to connect problem didn't occur so I guess I had messed something up in my logic that caused the issue. For anyone else who has similar issue, follow the best answer link and it will probably resolve your issues 😀

 

Best Answer
0 Votes