Is there any reference to connect lex bot with my rest api project?, i want to get pricing from my products , this enpoint is included in my project in a rest method (json request and response), however, I have tried to find any reference to call my rest api but I cant find any example.
The bot is using lambda function (nodejs), I am just beginning with amazon lex so I do not have any reference, I'm trying to modify the existing examples they provide (pizza ordering) but no idea by the moment!
Thanks in advance!
You can send messages to Lex from your endpoint using PostText or PostContent of the Lex SDK.
But after Lex processes the input, you can only either allow Lex to create the response and respond to the sender, or pass the Lex Event to Lambda for validation and parsing (the better option for more control).
So to pass the Lex Event to your endpoint, simply use the Lambda function.
You can use Request module or the default http or https of Node.js.
You can find a good answer on how to do that here: How to make remote REST call inside Node.js? any CURL?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With