Data Action - 400 Bad Request - Unexpected Token in Architect Flow

Another data action issue - seems the Architect flow is sending a malformed payload to a POST endpoint. PureCloudPlatformClientV2 is constructing the JSON as expected, but the API is rejecting it with a 400. It’s not a CORS issue; the preflight OPTIONS request clears fine.

The underlying problem is probably the Architect flow isn’t correctly serializing the nested object, even though the SDK handles that. Here’s the error payload:

{
 "message": "Unexpected token 'a' in JSON at position 123",
 "code": 400,
 "status": "BAD_REQUEST",
 "details": []
}

We’re on Zoom Contact Center, using the latest stable SDK version - v9.1.0. It’s doing jack all with the nested array of strings.

{
 "requestBody": {
 "customField1": "value1",
 "customField2": {
 "nestedField1": "nestedValue1",
 "nestedField2": "nestedValue2"
 }
 }
}

Hello. This is very common, i think. The Data Action, it’s… how to say… picky about the JSON structure. It’s not the SDK - it’s the way Architect prepares it. You must to check the Content-Type header. I have had same problem, maybe two weeks ago.

The problem is probably the Architect flow is sending ‘application/json; charset=UTF-8’. It must be ‘application/json’ - no charset. I found this in a very old post, someone was saying the parser is strict. Very strange they don’t write about this in docs. You’ll need to edit the Data Action configuration - look for the ‘Request Headers’ section, and change it. It’s always something you don’t expect, yes? I have seen this many times.