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
回答済み 1年前
  • 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
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ