Trying to set the wrap-up code via API right after the conversation ends. The docs say you can use the WrapUpCode resource. I’m using the .NET SDK v8.12.
Here’s the code:
var wrapUp = new WrapUpCode { Code = "wuc-123", Duration = 30 };
var result = await client.ConversationsApi.PatchConversationAsync(convId, new PatchConversationRequest { WrapUpCode = wrapUp });
Getting a 409 Conflict. The response body says:
{
"code": "conversation.not_found",
"message": "Conversation with id 'conv-xyz' not found or already terminated."
}
But the conversation is definitely there. I can GET it. Status is COMPLETED. I checked the timestamp. The conversation ended 2 seconds ago. Maybe it’s a race condition? The docs for WrapUpCode don’t mention a delay.
Also, if I wait 5 seconds, it works. But that’s bad UX for our agents. They need to see the wrap-up time update immediately. Is there a webhook I should be listening to instead? Or is the API just slow?
I tried using PUT instead of PATCH but that gives a 405 Method Not Allowed.
Also, the Duration field. Is that in milliseconds? The docs are vague. I put 30. If it’s ms, that’s 0.03 seconds. That seems wrong.
Any ideas? I’m on .NET 6. Azure Function. Genesys Cloud EU region.
Thanks.