-
Error: 400 Bad Request. Message: Invalid JSON payload. Path: $.custom_data.agent_priority. Reason: Expected integer, received string. -
Context: I am building a Django backend that pushes real-time analytics to Genesys Cloud via a webhook. This webhook triggers an Architect flow. The flow needs to update the participant’s custom data attributes using the
Set Participant Dataaction. Specifically, I need to pass an integer priority score and a string queue name. -
Current Implementation: My Django view constructs the payload and sends it to a CXone Studio snippet which then calls the Architect API. The Studio snippet uses
GetRESTProxyto execute the update. Here is the JSON structure I am sending to theSet Participant Dataaction’sdatafield:
{
"custom_data": {
"agent_priority": "5",
"target_queue": "Support_L1"
}
}
- The Issue: The
agent_priorityfield in the Genesys Cloud participant schema is defined as an integer. However, theSet Participant Dataaction seems to be strict about type enforcement when coming from this specific integration path. I receive the 400 error cited above. If I remove the quotes around5, the JSON parser in my Django layer complains about the schema validation before it even hits GC. Wait, no, the JSON is valid with an integer. Let me clarify. The Django serializer outputs:
{
"custom_data": {
"agent_priority": 5,
"target_queue": "Support_L1"
}
}
-
When I send this valid JSON with an integer
5, theSet Participant Dataaction logs a 400 error in the flow logs sayingType mismatch for field agent_priority. But it IS an integer. I have verified the JSON payload in the Django logs just before therequests.postcall. -
Question: Is there a known bug with the
Set Participant Dataaction regarding integer type coercion from external webhook payloads? Or do I need to wrap the value in a specific structure? I am using the Pythonrequestslibrary withContent-Type: application/json. The token is valid and refreshed via Celery every 50 minutes. Any insights on the exact JSON schema expected by this specific action node?