We’re running into a 400 Bad Request when trying to update the predictive dialing campaign settings through a flow and the REST Proxy action. The documentation states “The weightMatrix property accepts a JSON array of objects, each object containing agentId and weight properties” - but the nice-cxone-python library seems to be serializing the payload differently.
Specifically, the weightMatrix property is being converted into a string instead of a JSON array. It’s happening on the PUT request to /api/v2/outbound/campaigns/{campaignId}/predictive. Here’s the we’re using:
The to_dict() method is the issue - it’s flattening the weightMatrix into a string. We’ve tested bypassing the SDK and constructing the JSON manually, and it works, but it feels like we’re working around a bug. Is anyone else seeing this behavior with the SDK’s serialization?
The REST Proxy in is REALLY picky about types. If the Python library is sending numbers as strings, it’ll fail. Try forcing the weight to an integer in the payload. It’s possible the serialization is just off. Anyone seen this?
ok so, fun one today. The type mismatch mentioned in the earlier reply is a common culprit, but it’s worth checking the structure of the array itself.
Are the objects being passed as a raw string or a structured JSON array? If the logic is simply concatenating strings to build the list, the REST Proxy might be rejecting the malformed syntax before it even evaluates the data types. Feel free to share the logic flow if you’re unsure.
The type mismatch is usually the culprit. Also, check the agentId format. If it’s passed as a string instead of an integer, the REST Proxy will choke. We’ve got 1200 agents and this happens constantly when syncing WFM IDs. Use int(agent_id) in the payload before sending.