Stuck on parsing a JSON response inside a CXone Studio Snippet. I’m calling an external service via GetRESTProxy to fetch user attributes. The call succeeds, status code is 200. The response body looks correct in the debug trace.
Here’s the snippet:
SET restProxy = GetRESTProxy("my-proxy");
SET response = restProxy.Execute("GET", "/users/123", {}, {});
SET status = response.StatusCode;
SET body = response.Body;
SET userData = response.Data;
body contains the raw string. userData is null. I need to extract a specific field, say email. The docs mention using JSONPath, but I can’t find the exact syntax for the Snippet language. Is there a built-in function like ParseJSON or do I have to use a regex match on the body string? Tried response.Data.email and it errors out with Cannot read property 'email' of null.
Any pointers on the correct way to drill into the JSON object in Studio?