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 Antwort
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
beantwortet vor 2 Jahren
  • 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

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen