You need to include an AWS Signature in the Authorization tab, containing the details of an IAM user that has access to run your Lex bot.
Steps:
1. In AWS go to IAM -> Users -> Add User
- Give it a Username like "myBotUser" and select an Access Type of "Programmatic access". Hit Next:Permissions.
- Hit Create Group to create a group to give permissions to the user.
- Give it a name and then filter the policies for Lex - and select "AmazonLexReadOnly" and "AmazonLexRunBotsOnly".
Hit Create Group.
- Then hit "Next: Review".
Then hit "Create User" - and your IAM user is ready. You'll see an Access key ID and a Secret Access Key.
In Postman, in Authorization, select AWS Signature and enter in the Access key ID and the Secret Access Key, along with an AWS Region of "us-east-1" and a Service Name of "lex":
- Make sure you're body is as required (here I'm just sending text):
Hit Send and you should get a response like this:
{
"dialogState": "Fulfilled",
"intentName": "yourIntentName",
"message": "A response for that intent",
"responseCard": null,
"sessionAttributes": {},
"slotToElicit": null,
"slots": {}
}
Update
Note also - the POST url would be in format:
https://runtime.lex.us-east-1.amazonaws.com/bot/MyBotName/alias/myMyAlias/user/aUniqueUserID/text and it should be a POST
Also make sure the header Content-Type is application/json, as is the body.