I keep receiving an error with my fit bit request specified in step 4 of the authorization guide.
I get userCode from the call back url.
const sendJson = {
"method": "POST",
headers: {
Authorization: 'Basic MjNCSFM4OmM0ZTI2Mjg0MjIzOWQwNWQzZjljNzU2ZGExZDAzZmUw',
'Content-Type': "application/x-www-form-urlencoded"
}
};
fetch(requestUrl, sendJson)
.then(response => response.json())
.then(data => console.log(data));
In postman my error returned is
"errors": [
{
"errorType": "invalid_grant",
"message": "Authorization code invalid: cff86e02c5c4c9f5bdbf3253c1c675661f3b16d4 Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process." }
],
"success": false
}
Not sure why i am getting this error.