I am creating an Alexa skill with account linking. I got the Linking Authorization Code and exchanged it for an Access Token. then, I tried to put all of the paramaters: code, access token, skill ID, into the Alexa Skill Activation API. I always get a massage: "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 I got from the start
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;
});
what to do?