GetRESTProxy INVALID_FUNCTION error in CXone Studio Snippet

Running into a weird issue with a CXone Studio Snippet. I’m trying to make a simple REST call to an external endpoint using GetRESTProxy(), but the snippet fails immediately with an INVALID_FUNCTION error. This is baffling because the function exists in the docs and works in other flows.

Here’s the snippet code:

var proxy = GetRESTProxy();
var request = proxy.CreateRequest('POST', 'https://api.example.com/webhook');
request.SetHeader('Content-Type', 'application/json');
request.SetBody('{"test": true}');
var response = request.Execute();
Assign('result', response.Body);

The error points directly to the GetRESTProxy() line. I’ve checked the Studio logs and it says Function 'GetRESTProxy' is not defined or is invalid in this context. I’m using the latest Studio version. I’ve tried wrapping it in a try-catch, but it doesn’t even get that far. The execution stops at the assignment.

I’m used to working with Genesys Cloud APIs and their SDKs, so this feels like a basic syntax error, but I can’t find it. Is there a specific namespace or import required for GetRESTProxy in Studio? Or is this function deprecated? The docs are a bit vague on the exact syntax for the proxy object. I’ve also tried using CreateRESTProxy() but that gives the same error.

I need this to work for a data sync process. Any ideas? I’m stuck.