If I try to get my access_token, I always get back:
{"error":"invalid_client"}
Here is the call to Infusion api (I use NodeJS and node-fetch):
fetch(if_token_url, {
method : 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: {
'client_id' : if_client_id,
'client_secret' : if_client_secret,
'code' : if_tmp_code,
'grant_type' : 'authorization_code',
'redirect_uri' : redirect_uri
}
})
.then((api_response) => {
return api_response.text();
})
.then((api_response_text) => {
res.end(api_response_text);
})
.catch((api_err) => {
res.end(api_err.stack);
});
Iâve browsed through this forum and ruled out these possible reasons for the error:
- redirect_uri is the same for first âauthorizeâ request (which works; I get back the temporary code) and the actual âaccess tokenâ request (which fails with above error)
- I send it as âapplication/x-www-form-urlencodedâ
However, I also noticed this:
I would double check that the redirect_uri matches what you registered with in the developer portal
I have no idea where I could register my redirect URI in the developer portal.
Any tips?