-
Is there a code snippet that illustrates how to use UserEventRequest? But where exactly do I add this? Do I just add that single line in the constructor of the lambda?
A complete code snippet of a lambda that handles a UserEvent would be very helpful. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @abpatel You add the As for the response you send back - it depends on your skill setup. You can send almost any kind of response back from a UserEvent request: speech, a question, a new screen etc. You've said that in your case you want to change the data source depending on the selection, so having google'd the Alexa documentation - you'd need to ensure you're using a The documentation that came back when I googled "APL update data source" is below, and I try and make sure the names in the library are close enough you can always find them with a quick search - that way the Alexa docs are still the best way to figure out how to do something (some scenarios are just so specific I wouldn't be able to keep all the examples up to date) Hope this helps |
Beta Was this translation helpful? Give feedback.
Hi @abpatel
You add the
AddToRequestConverter
code once at startup (or in your function constructor if you're using a serverless pattern like AWS Lambda). This is an Alexa.NET pattern we use with the extensions, so when you look at theskillRequest.Request
property on your input, it can correctly deserialize aUserEventRequest
type when you receive one from your APL document (it doesn't break if you run it more than once, but it doesn't need to be run more than once at startup)As for the response you send back - it depends on your skill setup. You can send almost any kind of response back from a UserEvent request: speech, a question, a new screen etc.
You've said that in your case you wa…