1

I am creating a lambda based Alexa skill, and I need to input an IP address for a server that changes for every user that installs the skill. I know there is an account linking option but I need the IP of the server be inputted when the skill is installed.

How do I do that? and how do I pass those parameters to the lambda function? Thanks ahead.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Alon Eyal
  • 115
  • 9

2 Answers2

1

So this "IP adress for a server" where should it come from?

  • You could ask the user in the first skill invocation for the ip
  • Or do you need in written form? You could generate an id for the alexa skill userId, let alexa speak the id and the user use this id:
    • log in in your webpage with this unique id
    • configure/add an ip address
    • now your skill backend can lookup the ip adress for the userId
timguy
  • 2,063
  • 2
  • 21
  • 40
  • 1
    how do I ask for that IP in the invocation? – Alon Eyal Mar 29 '21 at 14:36
  • 1
    I updated my answer. You could use dialogue confirmation to get automatic dialogue for the confirmation. Play around if it's easier to split the IP maybe in 4 different slots. – timguy Mar 29 '21 at 19:42
  • 1
    Thanks for updating. How do I save that counter? and the IP? I need it to be unique to each user, and they don't need to say it more then one time. – Alon Eyal Mar 31 '21 at 05:35
  • 1
    OK, and about the form option - How do the form get the user's ID? because that way, I can put all of the inputs with the user ID in a database and use it the next time the skill is called. – Alon Eyal Mar 31 '21 at 10:41
  • ok thought you are gonna go with option one (collect by voice). The form does not need the user id. Your first skill invocation: you persist alexaUserID and yourself generatedID. Speak the generatedId to the user. The go the form and save input with generatedId and other stuff (ip). Because alexaUserId and generatedId is a 1:1 relation it's enought to know one of them. – timguy Mar 31 '21 at 11:29
  • I created the form myself, how do I get the ID from the account linking from the Alexa app automatically to the form so I can send it to a backend? The second option is the way I want my skill to work. – Alon Eyal Mar 31 '21 at 17:12
  • how do I do that? – Alon Eyal Apr 01 '21 at 04:59
  • which part? Learn alexa skill basics to speak out a generated id. Read about dynamo db or an other persistence option. Learn to build a website and connect it with your persistance layer. It's a bit hard to help here. Just start with the first step to generate a id, persist it and give it back to the user. – timguy Apr 01 '21 at 08:21
1

Can you initiate the linking request from that external server to the skill instead? Look at the App to App linking feature.

https://developer.amazon.com/en-US/docs/alexa/account-linking/app-to-app-account-linking-starting-from-your-app.html

LetMyPeopleCode
  • 1,895
  • 15
  • 20