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

已提问 2 年前385 查看次数
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

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则