I've been working on setting up an Alexa skill with account linking. After obtaining the Linking Authorization Code and exchanging it for an Access Token, I attempted to input all the necessary parameters: code, access token, and skill ID into the Alexa Skill Activation API. However, every time I do so, I keep receiving an error message stating "Invalid account linking credentials."
var clientServerOptions = {
uri: `https://api.amazonalexa.com/v1/users/~current/skills/${SkillId}/enablement`,
body: JSON.stringify({
stage: "development",
accountLinkRequest: {
redirectUri: "https://api.amazon.com/auth/o2/token",
authCode: req.body.code, //the code initially obtained
type: "AUTH_CODE"
}
}),
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${req.body.access_token}` //my access token
}
}
request(clientServerOptions, function (error, response) {
if(error != null) {
console.error(error);
} else {
console.log(response.body);
}
return;
});
Any suggestions on how to resolve this issue?