Pickup chat via api

ciao,

when we try to pickup a chat using api patch:

/api/v2/conversations/chats/{conversationId}/participants/{participantId}

as explained here : https://developer.genesys.cloud/api/digital/webchat/agentchat

passing conversationId and participantId with body:

{
"state": "connected"
}

we get the error:
{
"message": "Failed to update properties on conversation participant.",
"code": "conversation.participant.update.failed",
"status": 500,
"contextId": "81eef5a8-7890-43bd-afe0-0e812f3ca92c",
"details": [],
"errors": [
{
"message": "An internal conversation service error has occurred. Please contact support. Message: 500 : [{"errorCode":"chat.error","status":500,"correlationId":"81eef5a8-7890-43bd-afe0-0e812f3ca92c","userMessage":"An error has occurred. Please contact support. Message: Request method 'PUT' not supported","userParamsMessage":"An error has occurred. Please contact support. Message: {message}","userParams":[{"key":"message","value":"Request method 'PUT' not supported"}]}]",
"code": "internal.server.error",
"status": 500,
"details": [
{
"fieldName": "state"
}
]

where do we go wrong?
thanks

Hello,

You are supposed to use a PATCH.
PATCH /api/v2/conversations/chats/{conversationId}/participants/{participantId}

Your error message says you are using a PUT: "Request method 'PUT' not supported"

Regards,

ciao Jerome,

but we are using a patch, :

that error in the logs is strange.
thanks

Finally found the reason.

The page you are looking at (i.e. https://developer.genesys.cloud/api/digital/webchat/agentchat) relates to Widget v2 (WebChat v2).

And you seem to create a Widget v1.0/WebChat v1 chat and try to answer it.
I get the same answer/failure than you when trying to answer a WebChat v1 via API.

Answering WebChat v1 via Platform API is not supported.
The support for PATCH /api/v2/conversations/chats/{conversationId}/participants/{participantId} is for WebChat v2 (hence why the it is explained in the Agent Chat page related to Widget v2 - i.e. WebChat v2).

Regards,

thank you so much Jerome!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.