StartCallAnalyticsJob : User is not authorized to access this resource

0

Hi everybody,

I wanna ask you about AWS Transcribe Analytics Call. API is well with AWS Transcribe but I need also sentiment Analysis, so I try to use AWS Transcribe Analytics. There is my code :

from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-east-1')
job_name = "my-first-call-analytics-job"
job_uri = "PATH_S3_TO_WAV_WHO_HAD_WORD_FOR_AWS_TRANSCRIBE"
output_location = "PATH_TO_CREATED_FOLDER"
data_access_role = "arn:aws:s3:::MY_BUCKET_NAME_WHERE_WAV_FILES"
transcribe.start_call_analytics_job(
     CallAnalyticsJobName = job_name,
     Media = {
        'MediaFileUri': job_uri
     },
     DataAccessRoleArn = data_access_role,
     OutputLocation = output_location,
     ChannelDefinitions = [
        {
            'ChannelId': 0, 
            'ParticipantRole': 'AGENT'
        },
        {
            'ChannelId': 1, 
            'ParticipantRole': 'CUSTOMER'
        }
     ]
)
    
while True:
   status = transcribe.get_call_analytics_job(CallAnalyticsJobName = job_name)
   if status['CallAnalyticsJob']['CallAnalyticsJobStatus'] in ['COMPLETED', 'FAILED']:
     break
   print("Not ready yet...")
   time.sleep(5)
print(status)

I had done aws configure and I use a IAM user who have AdministratorAccess.

botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the StartCallAnalyticsJob operation: User: MY_ARN_USER is not authorized to access this resource

Any help please ?

Thank you very much!

1 Answer
0

Looks like your script doesn't have the right IAM permission to call this API. How are you configuring the credentials for this script? Take a look at this docuemntation for how to configure it. Also make sure the IAM user/role you are using has the correct permission to access Transcribe. To start with, you can use the managed AmazonTranscribeFullAccess policy and later shrink down to only the operations you need.

AWS
S Lyu
answered 2 years ago
  • Hello I repeat the following steps and I get the same error.

    I creat a new IAM account Checked Access key - Access by programming Add permission AmazonTranscribeFullAccess

    I enter "aws configure" on terminal then the Access Key ID, Secret Access Key, region us-east-1 and output format json. I run the code and still get the error botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the StartCallAnalyticsJob operation: User: [ARN USER THAT I JUST CREATED] is not authorized to access this resource

    Any help please ? I don't understand why AWS Transcribe work but AWS Transcribe Analytics not working ....

  • If the error message says ...User: [ARN USER THAT I JUST CREATED] is not authorized to access this resource then it means the python script is picking up the correct user. I also double-checked that the policy AmazonTranscribeFullAccess contains the StartCallAnalyticsJob permission. You can maybe try explicitly add the transcribe:StartCallAnalyticsJob permission to your IAM user.

    Are you using a personal account or a company account? Is the account in a AWS Organization? Maybe there are company-wide IAM permissions boundary that blocks you from using it?

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