I’m trying to call an internal API from a CXone Studio snippet to fetch customer data before routing. I’ve been reading the docs on GetRESTProxy, but I keep hitting an INVALID_FUNCTION error when the script runs.
Here is the snippet code I’m using:
ASSIGN rest = GetRESTProxy();
ASSIGN response = rest.Get("https://my-internal-api.com/customers/123", null, null);
The error log just says INVALID_FUNCTION on the second line. I figured GetRESTProxy returns an object I can call methods on, but maybe the syntax is wrong? I’ve tried passing headers as a JSON string in the second argument, but that didn’t help either.
Is there a specific way to initialize the proxy in Studio snippets? Or do I need to use a different method for a simple GET request? I’m new to CXone scripting, so I might be missing something basic about how the proxy object works. Any help would be appreciated.