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

HTTP/1.1 301 Moved Permanently

ANSWERED

Hi,

 

I am implementing Authorization Code Grant Flow. At step 3, I got the following error:

 


HTTP/1.1 301 Moved Permanently

Date: Mon, 29 Aug 2016 00:21:20 GMT

Content-Length: 0

Connection: keep-alive

Location: http://api.fitbit.com/token/

X-Frame-Options: SAMEORIGIN

Server: cloudflare-nginx

CF-RAY: 2d9bd7a263205408-LAX

 

My cURL data string looks like:

 

client_id=123xyz&grant_type=authorization_code&code=40359ca4b84aea1e180a4d45eff8ff4868d8188f&redirect_uri=http://localhost/incoming/fitbit.php

 

Is that because the redirect_uri isn't using https?

 

Thanks

 

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

What is the URL that you are requesting?

 

Two quick observations:

  1. The Fitbit Web API requires HTTPS.
  2. "http://api.fitbit.com/token" is not a valid endpoint. It should be "https://api.fitbit.com/oauth2/token".

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

What is the URL that you are requesting?

 

Two quick observations:

  1. The Fitbit Web API requires HTTPS.
  2. "http://api.fitbit.com/token" is not a valid endpoint. It should be "https://api.fitbit.com/oauth2/token".
Best Answer
0 Votes

oh, sorry, how could I miss that.

 

Yes, it is working now after I use the correct uri "oauth2/token".

 

Thanks a lot!

 

Best Answer
0 Votes