CXone Studio SNIPPET action: GETRESTProxy returning empty object despite 200 OK

Stuck on parsing a REST response in a CXone Studio SNIPPET action. I’ve got a simple flow where I need to fetch a JSON blob from an external service (internal microservice, no auth headers needed for now) and then assign a specific field to a contact attribute.

The call seems to work, at least the status code comes back as 200. But when I try to access the response body, it’s completely empty. No error, no data.

Here’s the snippet code:

ASSIGN [REST_PROXY] = GETRESTProxy("https://internal-api.example.com/v1/data/12345")
ASSIGN [REST_RESPONSE] = REST_PROXY.Execute("GET")

IF [REST_RESPONSE.Status] == 200
 ASSIGN [Contact.custom.payload] = REST_RESPONSE.Body
ELSE
 ASSIGN [Contact.custom.error] = REST_RESPONSE.Status
END_IF

I added a debug log right after the Execute call. The output for [REST_RESPONSE] looks like this:

{
 "Status": 200,
 "Headers": {
 "Content-Type": "application/json"
 },
 "Body": ""
}

The Body field is just an empty string. I checked the external service logs, and it’s definitely returning a JSON object like {"id": 12345, "status": "active"}. I’ve tried changing the verb to POST with a dummy payload, same result. Body is empty.

I know the endpoint is reachable because I can hit it from Postman and get the data. Is there a timeout happening in the snippet context? Or do I need to explicitly set a header in the GETRESTProxy config to handle JSON? The docs for GETRESTProxy are pretty sparse on error handling for non-200 responses, but this is a 200.

Tried wrapping the body in a string conversion just in case, didn’t help. Also tried accessing REST_RESPONSE.Body.id directly, which obviously failed since the body is empty.

What am I missing here?

The GETRESTProxy action in Studio doesn’t populate the response body into a standard variable by default. You need to explicitly map the JSON response to a contact attribute or a session variable using the output mapping fields in the action configuration. It’s not a code issue, it’s a config issue. The action returns the raw JSON string, but if you don’t tell it where to put it, it disappears. Check the “Output” tab of that specific action node. You’ll see fields for Response Body and Response Headers. Map Response Body to a new contact attribute, say {{contact.externalData}}. Then in your next snippet, you can parse {{contact.externalData}} using standard JSON parsing if it’s not already an object. Here’s how the mapping should look in the action settings:

{
 "action": "GETRESTProxy",
 "settings": {
 "url": "{{contact.apiUrl}}",
 "method": "GET"
 },
 "outputs": {
 "responseBody": "{{contact.rawResponse}}",
 "responseHeaders": "{{contact.responseHeaders}}"
 }
}

Make sure {{contact.rawResponse}} is defined as a string attribute in your flow. If you’re trying to access specific fields directly, you might need a subsequent ParseJSON action or a snippet that converts the string to an object. Studio is finicky with direct object assignment from REST calls.

ASSIGN [ResponseJson] = GetRESTProxy(“https://example.com/data”, “GET”, “”, “”)
ASSIGN [ParsedData] = JSON.Parse([ResponseJson])
ASSIGN [Contact.Attribute] = [ParsedData.fieldName]


You're missing the parse step. `GetRESTProxy` hands you a raw string, not an object. Parse it first, then grab the field.