amazon-connect / amazon-connect-chatjs

Amazon Connect ChatJS - a browser-based contact center integration API for Chat on the Agent and Customer side.
https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html
Apache License 2.0
97 stars 56 forks source link

sendMessage from agentChatSession #242

Open atifatl opened 3 days ago

atifatl commented 3 days ago

We are trying to create custom chat session for customer as well as for agents. From customer side we are able to integrate all the apis. From the agent side, it seems we are forced to integrate with web interface. If we are try to send Message from agentChatSession it always fails. We are trying with : https://github.com/amazon-connect/amazon-connect-in-app-calling-examples/blob/main/Web/amazon-connect-ccp-web-calling-example/src/services/ContactManager.js. Does agentChatSession support sendMessage. If yes what is the signature ?

atifatl commented 3 days ago

I just checked the log when i try to use contact.getConnection and try to send message : ERROR ["Send message error",{"type":"UnknownError","message":"User is not authorized to access this resource with an explicit deny",.......... "sessionType":"AGENT","region":"us-west-2"} My amazon connect region is us-east-1. I am getting error from us-west-2 Can you please please check

mliao95 commented 11 hours ago

Hi @atifatl,

Could you double check whether connect.ChatSession.setGlobalConfig() is set correctly for your given region? It makes sense that you would get an unauthorized error if your instance lives in a different region than where the API is calling.