aws lex bot api

0

when I tried to deal with aws lex bot api, I created a bot using aws console and it's wokring fine and face no probelm; but when I tried to use the aws api I got this error : { "message": "INVALID_REQUEST - Invalid bot name or alias" } I used this params into my api : https://runtime.lex.us-east-1.amazonaws.com/bot/botname/alias/aliasname/user/useid/text

I want to know if the probelm is related to the bot verison ? the botname and the aliasname are correct

2개 답변
1
수락된 답변

Hi,

Looks like you are not using Lex V2 endpoint (https://runtime-v2-lex.us-east-1.amazonaws.com/bot/botname/alias/aliasname/user/userid/text) as expected. In order to access Lex V2 Recognize Text API, you need to send a post request to the endpoint https://runtime-v2-lex.us-east-1.amazonaws.com//bots/botId/botAliases/botAliasId/botLocales/localeId/sessions/sessionId/text. I would recommend following this documentation closely to hit RecognizeText API through postman or any other http client.

Another option is to AWS CLI.

Sample command to hit RecognizeText API

aws lexv2-runtime recognize-text --bot-id “7TBXBYVXOE” --bot-alias-id “TSTALIASID” --locale-id “en_US” --session-id “test_123” --region us-east-1 --text “book hotel”

Related AWS CLI documentation can be found here

AWS
Satish
답변함 일 년 전
  • thanks so much, your response is the correct one

0

Hi,

One possibility is you may have created the bot using Lex V2 console which is the default interface for creating bots. And you are trying to access this bot through Lex V1 runtime APIs (https://runtime.lex.us-east-1.amazonaws.com/bot/botname/alias/aliasname/user/useid/text). Can you please try using Lex V2 runtime endpoint as documented here.

AWS
Satish
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠