[Docs] Alexa Skill Data


#1

Learn more about how to get access to user information.

User information is mainly used to offer a more personalized expierence, but you can't access it right away. First you have to ask for permission.


This is a companion discussion topic for the original entry at https://www.jovo.tech/docs/amazon-alexa/data

#2

Unable to get country and postal code using the following :

try {
                    const countryAndPostalCode = await this.$alexaSkill.$user.getCountryAndPostalCode();
                    countryCode = countryAndPostalCode.countryCode;
                    console.log(countryAndPostalCode);
                    console.log(countryCode);
                } 
                catch(error) {
                    if (error.code === 'NO_USER_PERMISSION') {
                        this.$alexaSkill.showAskForCountryAndPostalCodeCard()
                            .tell(`Please grant access to your Country and Postal Code in the Alexa app.`);
                    } 
                    else {
                        // console.log(error.code);
                        return this.tell('Something is wrong with me, please contact the manager');
                    }
                }

I have set the relevant permissions in skill.json and also given proper permission to the skill while using it.
The console.log statements in the try block above prints :

{}
undefined

I need urgent help with this.


#3

Does your Amazon account, you are testing with, have the information about postal code and country code?