Alexa user data

amazon-alexa

#1

Hi everybody!
I need help with Alexa authentication.
is it possible to trace the data of the user who is using my skill? In detail the email of the user’s account


#2

Hi Simone,

you can check here: https://www.jovo.tech/marketplace/jovo-platform-alexa/permissions-data#contact-information

await this.$alexaSkill.$user.getEmail()

// Example
async GetEmailIntent() {
    try {
        const email = await this.$alexaSkill.$user.getEmail();
        this.tell(`Your email address is ${email}`);

    } catch(error) {
        if (error.code === 'NO_USER_PERMISSION') {
            this.$alexaSkill.showAskForContactPermissionCard('email')
                .tell(`Please grant access to your email address.`);
        }
    }
},

Make sure you have set the permission in your skill:

image

Best,
Dominik.


#3

Thank you @dominik-meissner!


#4

@dominik-meissner
How can I use this.$alexaSkill.showAskForContactPermissionCard?
Because, at the moment the display interface is disabled


#5

you dont need the interface. It will send a “Alexa Card” in your smartphone Alexa App.


#6

It’s strange, because if I add this in my code:

try {
      const email = await this.$alexaSkill.$user.getEmail();
      console.log(email);
      this.tell(`Your email address is ${email}`);
    } catch (error) {
      console.log(error.code);
      if (error.code === 'NO_USER_PERMISSION') {
        this.$alexaSkill.showAskForContactPermissionCard('email').tell(`Please grant access to your email address.`);
      }
    }

Alexa replied with this:
vcare-chatbot-test asks you to provide permissions. For more details, see the alexa app


#7

@dominik-meissner I solved it! Thank you for your help