Akhil Gudimetla
Akhil Gudimetla

Reputation: 342

How to integrate AWS Lex Chatbots Voice to Facebook

I had configured my chatbot using AWS Lex Chatbot service. My main intention to create chatbot is to integrate it to Facebook and the user's communication should possible in both text and voice. I integrated my chatbot to facebook successfully by following steps give in AWS documentation. BUt voice piece was not working on facebook. Please, provide me any suggestions or any reference blogs of integrating lex voice piece to Facebook along with the text.

Upvotes: 1

Views: 345

Answers (1)

Jay A. Little
Jay A. Little

Reputation: 3287

Facebook Messenger doesn't interpret lex responses into Voice responses, at least not yet.

The event object received, when accessing Lex from Facebook, will generate requestAttributes and those specify the accepted content types under x-amz-lex:accept-content-types.

"requestAttributes": {  
    "x-amz-lex:accept-content-types": "PlainText"
},

As you can see, PlainText is the only accepted content-type. Even though Lex has 4 supported message content-types: 'PlainText', 'SSML', 'CustomPayload', and 'Composite'. See here.

From Facebook Messenger Docs:

The Messenger Platform allows you to attach assets to messages, including audio, video, images, and files.

Even though Facebook accepts attachments of audio, Lex only sends PlainText or SSML. Lex does use Facebook's messsage attachments when it sends Response Cards, but the Response Cards can only have a Generic Type, so that it only sends images, not audio files. See here.

Upvotes: 1

Related Questions