Skip to content

Amazon Connect GetTranscriptCommand getting 403 error

0

I'm trying to get a transcript from Amazon Connect on the backend side, however, I'm getting a 403 permission denied error.

Here's the code I'm using:

import { ConnectParticipantClient, CreateParticipantConnectionCommand, GetTranscriptCommand } from "@aws-sdk/client-connectparticipant";

const client = new ConnectParticipantClient({
  region: 'us-west-2'
});

const createConnectionInput = {
  ParticipantToken: "participant-token", // obtained from StartChatContact
  Type: ["WEBSOCKET", "CONNECTION_CREDENTIALS"]
};

const createConnectionCommand = new CreateParticipantConnectionCommand(createConnectionInput); 

After we are getting and 403 error

CreateParticipantConnectionCommand AccessDeniedException: 
Unable to determine service/operation name to be authorized

The remaining part of code just to provide a full picture

try {
  const createConnectionResponse = await client.send(createConnectionCommand);
  const connectionToken = createConnectionResponse.ConnectionCredentials.ConnectionToken;

  const transcriptInput = {
    ContactId: "contact-id",
    ConnectionToken: connectionToken,
  };

  const transcriptCommand = new GetTranscriptCommand(transcriptInput);
  const transcriptResponse = await client.send(transcriptCommand);
  console.log("Transcript retrieved successfully:", transcriptResponse);
} catch (error) {
  console.error("Error:", error);
}

The documentation I've used

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectparticipant/command/CreateParticipantConnectionCommand/


https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connectparticipant/command/GetTranscriptCommand/



Does this possibility exists? Am I doing smth wrong?

Thanks!

asked 2 years ago282 views

1 Answer
0

The 403 "AccessDeniedException: Unable to determine service/operation name to be authorized" error with Amazon Connect Participant Service API usually means there are authentication or permission issues. To resolve this:

  1. Ensure your AWS credentials have permissions for these actions: a/ connect-participant:CreateParticipantConnection b/ connect-participant:GetTranscript
  2. Verify the AWS region in your client matches your Amazon Connect instance region (e.g., us-west-2).
  3. Check your ParticipantToken is valid and correctly obtained from the StartChatContact API.
  4. Make sure you are using the latest AWS SDK and that credentials are properly configured.
  5. Use AWS CloudTrail to trace API calls and identify permission problems.
  6. Test with AWS CLI to see if the problem is related to your code or broader permissions. If issues persist, review your IAM policies thoroughly to ensure proper authorization. This error often arises from missing or incorrect IAM permissions or region mismatches.
AWS

answered a year ago

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.