Data Action Parameter - Incorrect Type Handling

Hey everyone,

purecloudplatformclientv2 is throwing a 400 Bad Request when trying to update a data action parameter. According to the documentation, “parameters are strongly typed and must match the data type defined in the action”. It’s saying the issue is with the params object - specifically, it’s expecting a string but receiving an integer.

The code looks like this:

from purecloudplatformclientv2 import Configuration, api
config = Configuration()
data_action_api = api.DataActionsApi(config)
action_id = "a1b2c3d4-e5f6-7890-1234-567890abcdef"
params = {"param_name": 123}
try:
 data_action_api.data_action_patch(action_id, params)
except Exception as e:
 print(f"Error: {e}")

I’ve checked the data action definition in Architect and it is a string parameter. It’s odd because the API doesn’t seem to be doing any type conversion. The error message is: {'message': 'Bad Request', 'code': 400, 'details': [{'field': 'params.param_name', 'message': 'must be type string', 'code': 'invalid_type'}]}.

It’s happening on our production instance. We’re on NICE CXone, using the latest version of the SDK - 17.2.0.

Cause: yes, is always types. the API is very picky - i have same problem last week with the Data Action. Docs don’t say you must cast to string.

Solution: try this, is very simple.

params = {"param_name": str(your_integer_value)}

i see same thing in other post - you must always convert. very annoying.

genesys-cloud-sdk also needs everything as strings - even if it looks like a number. The fix above works, but you’ll hit this again. Try this payload:

{"param_name": "12345"}