I am trying to implement aws business q apis inside my own application. I am following below document provided by aws but it’s not working for chat_sync function.
https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/making-sigv4-authenticated-api-calls.html#data-plane-workflow
- Created temporary session using AssumeRole
sts_client = boto3.client('sts')
response = sts_client.assume_role(
RoleArn='arn:aws:iam::XXXXXXXX:role/assume_role',
RoleSessionName='temp_sess'
)
- Setting up the session values received from step 1.
session = boto3.Session( aws_access_key_id='XXXXXXXX', aws_secret_access_key='XXXXXXXXXXXXXX', aws_session_token='XXXXXXXXXX' ) aq_client = session.client( "qbusiness", region_name="us-east-1" ) resp = aq_client.chat_sync( applicationId = "amazon-qbusiness-application-id", userMessage = "chat-request", clientToken = str(random.randint(0,10000) )
getting below error message
An error occurred (AccessDeniedException) when calling the ChatSync operation: User ID must be null and identity-aware credentials must be passed for identity-center enabled applications
After passsing userId as a parameter also it’s not working.
I have tried all the steps mentioned in the document but error is not getting resolved. Please help with the latest codebase.
Pradnyesh S is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.