Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the account info of the user when the user uses an Alexa Skill

We are going to create an Alexa Skill that allows the user to control a Wi-Fi LED. Every time the user uses that Skill, we hope that we can get the user's account info in a callback of the SDK used in the AWS Lambda function for that skill.

Like for instance, the user logged in to his Amazon Account and used his Alexa-Enabled device and spoke "Alexa, ask to turn on". Then the skill we made will trigger the Lambda function and pass on the user's account details so that we could check it in our host whether that user own's that device.

So, is there any callback in the Java SDK used in the Alexa Skill Kit containing the account info of the user?

Thanks!

like image 908
JLT Avatar asked Dec 28 '16 08:12

JLT


People also ask

Does this Alexa skill collect users personal information?

4. Purposes of processing your personal information. We process your personal information in order to operate, maintain and provide you with the features and various functionalities of the Skill as well as to provide customer service and support.

How do you find out what account Alexa is linked to?

You can also say "Alexa, identify account" to identify whose account you're currently logged in to.

Can you track someone through Alexa?

With the My Locator skill, you can just ask Alexa where your family members are. The My Locator skill connects Alexa to your GPSOnIt.com account, for easy voice access. To hear a sample without linking your account, just enable My Locator and say, 'Alexa, ask My Locator for an example'.

How do I view my profile on Alexa app?

Open the Alexa app . Open More and select Settings . Select Your Profile and Family. Select Your Profile.


1 Answers

The SDK just provides you with a userId...

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

This identifies a particular user, for one installation of your app. That is all you get automatically.

You can use account linking 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 sort of database/datastore, but you don't need to load/save it with each request - you can store this user info (or any other session data) in your response and the SDK will pass it back to you in the next request within the same session.

like image 194
Tom Avatar answered Sep 21 '22 13:09

Tom