aws amaon connect chat aws connectparticipant send-message --content-type 'text/plain' --content hi --connection-token xxxx gives "User is not authorized to access this resource with an explicit deny

0

for unit testing I am exercising amazon connect chat via cli aws connect start-chat-contact <<< comes back with ParticipantToken aws connectparticipant create-participant-connection --type WEBSOCKET --participant-token <<< come back with ParticipantToken

aws connectparticipant send-message --content-type 'text/plain' --content hi --connection-token xxxx gives "User is not authorized to access this resource with an explicit deny"

user has Administrator rights

1回答
0

Hi,

your request is rejected since you're passing the participant token on your send-message operation instead of the connection token.

You can come around by changing the connection type like this:

aws connect start-chat-contact --instance-id XXX --contact-flow-id YYY --participant-details DisplayName=ZZZ
// Returns participantToken
aws connectparticipant create-participant-connection --type CONNECTION_CREDENTIALS --participant-token <participantToken>
// Returns connectionToken
aws connectparticipant send-message --content-type text/plain --content hi --connection-token <connectionToken>
/* Returns MessageId and timestamp e.g.:
{
    "Id": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
    "AbsoluteTime": "2022-10-26T07:03:19.534Z"
}
*/

profile pictureAWS
faddi
回答済み 2年前
  • thanks. this got me to the point shown but the hi message did not come through to the agent and the event log did not show the hi. Missing another step it looks like

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

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

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

関連するコンテンツ