CXone Studio Snippet GetRESTProxy returning null response body

Stuck on parsing a JSON response in a CXone Studio Snippet. I’m trying to call an internal API to fetch user preferences before the agent takes the call. The HTTP request itself seems fine-getting a 200 OK-but the response object in the snippet is coming back empty or null when I try to parse it.

Here’s the flow:

  1. Create REST Proxy
  2. Set headers (Authorization, Content-Type)
  3. Execute request
  4. Assign response to variable
  5. Parse JSON

The code looks like this:

{
 "actionType": "GetRESTProxy",
 "input": {
 "requestUrl": "https://internal-api.example.com/v1/preferences",
 "requestMethod": "GET",
 "requestHeaders": {
 "Authorization": "Bearer {{session.token}}",
 "Accept": "application/json"
 }
 },
 "output": {
 "restProxy": "prefProxy"
 }
}

Then immediately after:

{
 "actionType": "ExecuteRESTProxy",
 "input": {
 "restProxy": "prefProxy"
 },
 "output": {
 "statusCode": "prefStatus",
 "responseBody": "prefBody"
 }
}

When I log prefBody to the transcript, it’s blank. If I change the URL to a dummy echo service, it works. The internal API returns valid JSON. I’ve tried adding a wait action between the two, but that didn’t help. Is there a specific way to handle async responses in Studio Snippets or am I missing a header requirement? The token is definitely valid since other calls work.

Studio snippets don’t parse JSON automatically. You’re getting the raw string. Use the ParseJSON action on the response body string before accessing properties. If it’s still null, check if your internal API is returning an empty object {}. That parses to an empty map, not null. Verify the payload structure first.