aws-samples / amazon-lex-twilio-integration

An AWS Lambda function that integrates Twilio Programmable SMS with Amazon Lex.
Apache License 2.0
18 stars 11 forks source link

Is there anything I should do/configure in order to make event include body-json field? #2

Closed tishma closed 7 years ago

tishma commented 7 years ago

Hi,

I'm wondering if I'm missing something, as by default I don't seem to have body-json in my lambda event parameter. No config param to somehow turn it on in neither Twilio nor Lex. var twilioSMS = qs.parse(event["body-json"]);

Any hint?

Thanks

tishma commented 7 years ago

Leaving a response for the record. This example is NOT a lambda Lex Code Hook for use with example found here: http://docs.aws.amazon.com/lex/latest/dg/twilio-bot-association.html

It is a lambda function that stands between Twilio and does the integration instead.

sfc-gh-ahkhan commented 7 years ago

This is an AWS Lambda function that fronts the Amazon Lex service and is the companion code to this blogpost: https://aws.amazon.com/blogs/ai/integrate-your-amazon-lex-bot-with-any-messaging-service/

Please follow the steps outlined in the above blogpost and let me know if you into any issues.

tishma commented 7 years ago

Yes! The blog post is just what we needed :) I've come across this repo thru Twilio support - trying to figure out how I could access the Twilio's 'To' field containing number that received the SMS, so I can use it to segment users in Lex Lambda Code Hook containing our business logic. Using the blog post I could easily modify userId event field to include both sender and recipient phone numbers. Thanks @filanthropic