Hit a wall with the GetRESTProxy function in a CXone Studio Snippet. The flow just errors out with INVALID_FUNCTION as soon as it hits the assignment block.
I’m trying to call an external endpoint to fetch contact details before the agent transfer. Here is the snippet code I’ve been testing with:
// Step 1: Initialize xy
ASSIGN restProxy = GetRESTProxy();
// Step 2: Set Headers
ASSIGN headers = {"Content-Type": "application/json", "Authorization": "Bearer " + token};
// Step 3: Execute Request
ASSIGN response = restProxy.execute("GET", "https://api.internal.com/v1/contacts/" + contactId, headers, null);
The error log specifically points to the ASSIGN restProxy = GetRESTProxy(); line. It’s not a timeout, it’s a syntax or availability issue.
I’ve checked the CXone Studio documentation, and GetRESTProxy is listed as a standard available function for REST calls. I’ve also tried wrapping it in a try-catch block (using the snippet’s error handling steps), but the error persists before any logic runs.
Is there a specific library import required? Or is this function only available in certain Studio versions? I’m on the latest environment, so it should be supported.
Tried removing the headers first to see if that was the blocker, but the error remains on the initialization line itself. Frustrating because the syntax looks identical to the examples in the help docs.