How to get user account information when a user uses Alexa skill

We are going to create an Alexa skill that allows the user to control the Wi-Fi LED. Each time a user uses this skill, we hope that we can get information about the user account in the SDK callback used in the AWS Lambda function for this skill.

Like, for example, a user logged into their Amazon account and used their Alexa-Enabled device and said, β€œAlexa, ask them to enable it.” Then the skill that we created will call the Lambda function and pass the details of the user account so that we can check on our host whether this user is the owner of this device.

So, is there any callback in the Java SDK used in the Alexa skillset that contains user account information?

Thanks!

+6
source share
1 answer

The SDK just provides you with a userId ...

{ "session": { "user": { "userId": "amzn1.ask.account.AFPabcdef<etc>" 

This defines a specific user for one installation of your application. That is all that you get automatically.

You can use account binding to manually associate this user with other accounts:
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system

You will need to store information about this user in some database / data store, but you do not need to load / save it with each request - you can save this user information (or any other session data) in your response and the SDK will pass it back to you in the next request during the same session.

+7
source

Source: https://habr.com/ru/post/1013566/


All Articles