I’ve got a C# Azure Function handling a Data Action webhook from Genesys Cloud. The function hits my internal CRM API, gets a valid response, and returns a 200 OK. The issue is the result object in the Data Action success output is coming back as undefined in the flow.
The docs say the response body should be valid JSON. My C# code looks like this:
var response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new StringContent(JsonSerializer.Serialize(new { id = "123", name = "Test" }));
return response;
I checked the network trace. The GC Data Action sends the request to my endpoint. I get the data. I return the JSON. But when I map the output in the Architect, result.id is null.
Is there a specific header I need to set? I tried adding Content-Type: application/json but it didn’t help. The docs quote: “The response body must be a valid JSON object.” I am sending a valid JSON object.
Here is the raw response I’m sending back:
{
"id": "123",
"name": "Test"
}
The Data Action configuration has the success endpoint set to my function URL. The timeout is 30 seconds. It’s way faster than that.
I logged the request in the Azure Function. The body coming FROM Genesys is correct. The body going BACK is correct. But the mapping fails.
Maybe the SDK is expecting a different structure? Or maybe the result variable name is hardcoded? I tried changing the property name to data but that didn’t work either.
Can someone show me a working C# example of a Data Action response? I’m stuck on this. The error log just says “Data action failed to parse response” but gives no details. I’m using .NET 6. The JSON serializer is the default System.Text.Json.
It’s frustrating because the HTTP status is fine. The content is fine. But the platform isn’t seeing it. I’ve checked the CORS settings too. That’s not it.
What am I missing here?