Lex Error message "There is no alias named "

0

Hello,

I'm trying to use postman to try out my LexBot. Ive followed this https://tutorials.botsfloor.com/test-an-amazon-lex-chatbot-using-a-rest-client-postman-c2d9ce81dcad which connects straight to the bot via the rest API but I keep getting the below error.

Ive tried the Bot name and ID and the Alias name and ID and a combination of them. The alias and bot are associated correctly (as far as i can tell).

Has anyone seen this before? Im sure im doing something wrong and its probably very basic.

"message": "There is no alias named MyBotName for the bot named myMyAlias. Choose another alias."

5 Answers
1
Accepted Answer

Did you build the Lex v2 bot? If so, you need to use the Lex v2 API endpoint. The documentation you referred to is a bit old and uses the v1 endpoint. I recommend trying out the v2 API endpoint and see if you still have the same issue.

AWS
Taka_M
answered a year ago
profile pictureAWS
EXPERT
reviewed a year ago
0

Thank you Taka_M. Yup, that was my issue.

Also, for anyone else reading this I struggled a little to find the new endpoint URL, depending your region you will find it https://docs.aws.amazon.com/general/latest/gr/lex.html.

However, I have hit an issue where in v2 the SessionID is required. Is there a way to generate a SessionID in Postman?

answered a year ago
0

Thanks Taka, am hitting the below issue now. from my post call, https://runtime-v2-lex.us-east-1.amazonaws.com/bots/botID/botAliases/botAliasID/botLocales/en_GB/sessions/test

{ "message": "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details." }

answered a year ago
0

I managed to get this working.

The error i was getting around the signature was due to my access key. You need to use user who has 'AmazonLexReadOnly' & 'AmazonLexRunBotsOnly' permissions.

Enter image description here

answered a year ago
0

hello @dowen93to98 I had a similar issues, but I got this error:

{
    "message": "Credential should be scoped to correct service: 'lex'. "
}

How did you give access? I'm kinda new in AWS i read a lot and I can't figure out what's going on, i did the following:

  1. Create a CLI aws account (test user)
  2. I added the permissions: AmazonLexReadOnly and AmazonLexRunBotsOnly I even added another that I read in another website ( I Created a new policy) with this json:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "lex:GetSession",
                "lex:RecognizeText",
                "lex:PutSession",
                "lex:DeleteSession",
                "lex:StartConversation",
                "lex:RecognizeUtterance"
            ],
            "Resource": "*"
        }
    ]
}
  1. I created an access api key/secret key
  2. Added to postman as AWS identification and hitting this url https://runtime-v2-lex.us-east-1.amazonaws.com/bots/KVI5WI1AAA/botAliases/UZA1JMDAAA/botLocales/en_US/sessions/random/text (the last letters I replaced with AAA just to hide the complete url and check if is the name or the ID)

I got the botId from lex website, the alias I think is the correct (same from lex but I'm not sure if is the name or this ID), the (access key 1 is the one I'm using, and says Access key last usedNever My user

I can't figure out what's wrong, I tried to read a lot of tutorials but I have no luck, could you please help me out and telling me how I can setup the user? Thanks

AutoZen
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions