import boto3
def lambda_handler(event, context):
responderName = event["DestinationBot"]
userId = event["SenderID"]
userInput = event["message"]["text"]
client = boto3.client('lex-runtime')
response = client.post_text(
botName=responderName,
botAlias="iSearchBotBeta",
userId=userId,
sessionAttributes={
},
requestAttributes={
},
inputText= userInput
)
Actually I already have created an chatbot in lex environment .But the problem is I want to integrate my lex chatbot response with my website using http post and get .Actually I am not getting any good solution.I would be happy if it could be provided in python because my lambdahook and fulfillment lambda's of lex all are written in python.
I have tried to call via a post request from another lambda but its not working correctly,actually I think, i am following wrong process.I would be helpful greatly if I get any solution.
I expect that it is possible but how ? .I am not getting any example of such .A small example of using lex api would be helpful to post and get things from a lambda would be great