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 Answer
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
answered 2 years ago
  • 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

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