Stuck on mapping a nested JSON response from an external REST call within an Architect Data Action.
I am building a Python-based sentiment analysis service that ingests transcript data via the Genesys Cloud Analytics API. I need to route this data to an external model endpoint for real-time scoring. I have configured a Data Action of type “http” with the following JSON body configuration:
{
"name": "SentimentCheck",
"type": "http",
"httpMethod": "POST",
"url": "https://api.mymodel.com/score",
"headers": {
"Authorization": "Bearer {{auth_token}}",
"Content-Type": "application/json"
},
"body": "{{transcript_text}}",
"result": {
"score": "$.score",
"label": "$.label"
}
}
The external API returns a JSON payload like:
{
"score": 0.92,
"label": "positive",
"metadata": {
"model_version": "v2.1"
}
}
When I test this in Architect, the execution fails with a 400 Bad Request error stating “Invalid result mapping.” The documentation suggests using JSONPath for the result mapping, but $.score works for flat objects. I suspect the issue lies in how the body is being serialized or how the result object is defined. I have verified the external API is reachable and returns the expected structure. Is there a specific syntax requirement for the result field when mapping to variables in a POST request Data Action? I need to map both score and label to local variables for downstream logic.