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.