alexa-samples / skill-sample-node-device-address-api

This is a sample skill written in JavaScript that demonstrates how to use device ID and the API endpoint values to make a request to the Alexa Device Address API.
Other
65 stars 54 forks source link

Cannot read property 'consentToken' of undefined #6

Open mehtanilay10 opened 6 years ago

mehtanilay10 commented 6 years ago

It gives below error. Even after enabling permissions for full address.

"errorMessage": "Cannot read property 'consentToken' of undefined",
    "errorType": "TypeError",
    "stackTrace": [
        "Object.getAddressHandler (/var/task/Handlers.js:59:68)",
        "emitNone (events.js:86:13)",
        "AlexaRequestEmitter.emit (events.js:185:7)",
        "AlexaRequestEmitter.EmitEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:216:10)",
        "AlexaRequestEmitter.ValidateRequest (/var/task/node_modules/alexa-sdk/lib/alexa.js:181:23)",
        "AlexaRequestEmitter.HandleLambdaEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:126:25)",
        "AlexaRequestEmitter.value (/var/task/node_modules/alexa-sdk/lib/alexa.js:100:31)",
        "exports.handler (/var/task/index.js:21:11)"
    ]

I have tried below values but got 403

const deviceId = this.event.context.System.device.deviceId;
const endPoint = this.event.context.System.apiEndpoint;
const token = this.event.context.System.apiAccessToken;
rahul003 commented 6 years ago

You need to grant this permission in the user's app

mehtanilay10 commented 6 years ago

Obviously I have enabled it!

rahul003 commented 6 years ago

I was only trying to help. There are multiple places where you need to ensure permissions. I'm sorry I tried. Have a good day.