My C# Azure Function is receiving Genesys Cloud webhooks for routing.queue.conversation.wrapup, but the delivery status keeps failing with a 500 Internal Server Error. The function itself logs success in Application Insights, so the logic is fine. I suspect the HTTP response handling is off. The docs say “The consumer must respond with a 2xx status code within 5 seconds.” My code returns OkObjectResult, but maybe the async context is dropping the status before GC times out. Here is the handler:
[FunctionName("ProcessGCWebhook")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequest req,
ILogger log)
{
log.LogInformation("Webhook received");
// Process payload
return new OkObjectResult("OK");
}
I need to implement a dead letter queue for these retries, but first I have to stop the 500s. Is OkObjectResult sufficient for the SDK, or do I need to manually set the HttpResponseMessage status code to 200? The retry logic in GC is hammering my function after the initial fail.