Closed lekanoni20 closed 5 years ago
Hi @lekanoni20 ,
Could you verify that your skill has enabled HoustholdList api option in the skill developer console? and also that you grant the permission in the skill page in the alexa app?
Would you mind updating your issue using our issue template here? It will help investigate the problem.
Regards
If your talking about enabling the list read and write permissions in the skill developer console then yes i have. Also, the skill is still in development so it's not on the skill store yet. I'll use the issue template to elaborate on the issue.
name: AccessDeniedException Error when calling householdlist API Code 403 about: Issue with householdlist api in SDK
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:
When I try to create a list, i am starting to get the AccessDeniedException Error 403 and this only recently started to happen. Below is the full error code i get when trying to run the test event in AWS Lambda.
Should get the success code and the list should be created successfully. Success code 201 with the appropriate listId created.
'x-amzn-errortype': 'AccessDeniedException:http://internal.amazon.com/coral/com.amazon.coral.service/', vary: 'Accept-Encoding,X-Amzn-CDN-Cache,User-Agent', 'x-cache': 'Error from cloudfront',
const addNewListAction = function(context, callback) {
console.log("prepare New List API call");
var path = "/v2/householdlists/";
console.log("path:" + path);
var postData = {
"name": "New List", //item value, with a string description up to 256 characters
"state": "active" // item status (Enum: "active" only)
};
const consentToken = context.System.apiAccessToken;
console.log(consentToken)
var options = {
host: api_url,
port: api_port,
path: path,
method: 'POST',
headers: {
'Authorization': 'Bearer ' + consentToken,
'Content-Type': 'application/json'
}
};
var req = https.request(options, (res) => {
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);
var data = "";
res.on('data', (d) => {
console.log("data received:" + d);
data += d;
});
res.on('error', (e) => {
console.log("error received");
console.error(e);
});
res.on('end', function() {
console.log("ending post request");
if (res.statusCode === 201) {
var responseMsg = eval('(' + data + ')');
console.log("new list id:" + responseMsg.listId);
callback(res.statusCode, responseMsg.listId);
} else {
callback(res.statusCode, 0);
}
});
});
req.end(JSON.stringify(postData));
};
Trying to create a list once a user triggers my createList Handler. Then once the list is created add, delete and update items from the list as well as read all the items from the list.
ASK SDK for Node.js used: Latest version in AWS Lambda Serverless Operating System and version: Windows 10
Node.js version used for development: 8.10
Issue solved
@lekanoni20 hello, how you have solved the problem?
Hi, When I try to create a list, i am starting to get the AccessDeniedException Error 403 and this only recently started to happen. Below is the full error code i get when trying to run the test event in AWS Lambda, 'x-amzn-errortype': 'AccessDeniedException:http://internal.amazon.com/coral/com.amazon.coral.service/', vary: 'Accept-Encoding,X-Amzn-CDN-Cache,User-Agent', 'x-cache': 'Error from cloudfront',
I was wondering if anyone else has had this issue recently or knows how to solve it ?