Hey folks,
I’m hitting a wall with a Studio snippet that’s supposed to fetch customer data from our internal REST API. The goal is pretty simple: grab the user ID from the interaction context, call an endpoint, and store the result in a data action output.
The snippet looks like this:
var clientId = "my-client-id";
var clientSecret = "my-secret";
var restProxy = GetRESTProxy(clientId, clientSecret);
var url = "https://api.example.com/v1/customers/" + userId;
var response = restProxy.get(url);
output.customerData = response.body;
It works fine in the sandbox environment. I can see the 200 OK response in the logs and the JSON payload is correct. But as soon as I push this to production, the snippet fails with INVALID_FUNCTION. The error log points directly to the GetRESTProxy line.
I’ve checked the client ID and secret. They’re valid. I’ve even tried hardcoding a dummy URL to rule out any path issues. Same error. The function just doesn’t exist or isn’t callable in the prod runtime.
We’re using Terraform to manage our CXone environment, so I’m wondering if there’s a specific capability or permission that needs to be enabled via the nice_cxone_user or nice_cxone_application resources for Studio to access external REST proxies. I’ve looked through the provider docs, but I don’t see a flag for “allow REST proxy in Studio”.
Is this a known limitation in certain production environments? Or am I missing a step in the OAuth setup? The docs are a bit light on troubleshooting INVALID_FUNCTION for this specific method. Any pointers would be appreciated.