Search the list of roles to find the new role.Name this role lambda-exec-role-for-lex, and then choose Create role. On the next page, choose Next Step without selecting a policy (you’ll define a custom policy).In this case, that event is an HTTPS call to API Gateway made by Twilio.īefore diving into coding the Lambda function, you need to set up permissions. Lambda gives you the ability to run custom code based on an event. Lambda–the preprocessing layer between Amazon Lex and Twilio But first, you need to create your serverless application. We’ll return to the Twilio Console to configure the webhook that posts the SMS message to our serverless application. On the Twilio Console Dashboard, note your Twilio AUTH TOKEN. Make sure that your Twilio number has SMS capability turned on, and that you verify your own phone number with Twilio for testing. If you don’t already have a Twilio account, you can sign-up for a trial account, which includes a free phone number. Next, set up a Twilio SMS-enabled phone number where users can send SMS messages to interact with your bot. Let’s change that! Setting up an SMS-enabled Twilio phone number You now have a working bot, but it can’t communicate with anyone outside the console. After Amazon Lex builds the bot, test it in the console.Choose the BookTrip sample, note the name of the AWS Identity and Access Management (IAM) role, and choose Create.Log in to the Amazon Lex console, and choose Create in the Bots.For this example, use one of the example bots that are provided in the Amazon Lex console. An HTTPS response is sent to the Twilio endpoint, which relays the message to the user as an SMS text message.You can implement your own custom routing logic and send messages to different bots based on your own business rules. For the sake of brevity, I haven’t included custom logic in this example. The Lambda function runs your business logic and uses the PostText runtime API call to communicate with your chatbot(s). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |