I’m hitting a wall with a Data Action that queries NICE Cognigy for user profile tokens. The goal is to inject the cognigy_profile_id into my OpenTelemetry span context before the conversation hits the main flow.
The HTTP call works fine in Postman. It returns a 200 OK with the expected JSON. But when I run the same request through the Genesys Cloud Data Action, it bombs out with a 400 Bad Request. The error message is vague: Invalid JSON response from external system.
Here’s the Data Action configuration JSON I’m using for the external call:
{
"type": "http",
"method": "GET",
"url": "https://api.cognigy.com/v2/profiles/{userId}/tokens",
"headers": {
"Authorization": "Bearer {{secrets.cognigy_api_key}}",
"Content-Type": "application/json"
},
"responseMapping": {
"profileId": "$.data.tokenId",
"expiresAt": "$.data.expiry"
}
}
The response from Cognigy looks like this:
{
"status": "success",
"data": {
"tokenId": "tok_8839201",
"expiry": 1715623400
}
}
I’ve verified the JSON path $.data.tokenId is correct using a standard JSONPath tester. It works there. But Genesys seems to choke on it.
I suspect the issue might be how Genesys handles the nested object structure or maybe there’s a hidden charset issue in the response headers from Cognigy that trips up the parser. I’ve tried adding Accept: application/json to the request headers, but that didn’t help.
Is there a known limitation with how the Data Action parser handles nested JSON from third-party APIs? Or do I need to flatten the response using a script step before mapping? I’m running out of ideas here.