How to publish Amazon Lex Chatbot as webservice

I can create Amazon lex chat bots. I can also post the same on Facebook messenger. Also I found sdk for iOS and Android.

I want to publish a lex bot as a web service that can be called from any client client so that it can be integrated into any UI with the rest of the calls.

I've heard about the Javascript sdk for publishing lex bots as a service, but I can't find any relevant documentation on this.

+3


source to share


2 answers


The Lex runtime is available from the Javascript SDK. The AWS documentation is here: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/LexRuntime.html

The hardest part is authentication. Amazon's recommendation is generally to route your Lex requests through a Lambda function in front of the API gateway. An alternative is to have an unauthenticated Cognito role that has permission to call Lex and then clients call this directly.



The getting started guide might be helpful if you are not familiar with calling AWS from a browser: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-started-browser.html

+4


source


You can use AWS API Gateway, which will receive requests from your Rest client and forward it to Lex.

Your architecture will look like this:
Chat Client <==> AWS API Gateway <==> AWS Lex



Read more on this link .

0


source







All Articles