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

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠