I'm using the following API to answer a chat:
PATCH /api/v2/conversations/chats/{conversationId}/participants/{participantId}
However, when passing (mediaParticipantRequest.State = MediaParticipantRequest.StateEnum.Connected) as a parameter, the following error occurs:
"conversation.participant.update.invalid"
"message":"Access to Conversation {id} is forbidden.","code":"not.authorized","status":403,"details":[{"fieldName":"state"}
Detail:
When I use (mediaParticipantRequest.State = MediaParticipantRequest.StateEnum.Disconnected) to disconnect Participant, it works correctly.
It is not possible to answer a chant on behalf of someone else - as I assume that's what you are trying to do.
I mean that if you are using an access token obtained from an OAuth Client Credentials Grant client, and trying to answer a chat which is alerting a user/agent, it is not supported.
Only the user who has the chat in alerting can answer it (i.e. an access token related to the user who has the alerting chat - like Implicit Grant, Authorization Code Grant, SAML2 Bearer Grant).
Thanks for the answer.
I'm not wanting to answer on behalf of the Agent, no.
I need to place an Api call in the Script, so that when a Chat arrives at the Agent, it automatically answers this Chat. Like an Auto Answer.
If you are executing a Genesys Cloud Data Action in your Script, the Data Action is using a Client Credentials grant (OAuth Client with Client Credentials Grant used by the Genesys Cloud Data Action integration).
So it is not possible to answer the chat invoking this Genesys Cloud Data Action as I explained above.
There is a Genesys Cloud idea on Auto-answer for digital channels. It has been accepted - but in the comments (september 21st 2021): "We do expect to begin work on this feature in 2022, but it's still TBD for a targeted date/quarter."