Trying to hit a custom endpoint in a Studio snippet using GetRESTProxy, but the response object is always null. Here’s the setup:
ASSIGN restProxy = GetRESTProxy("custom", "GET", "/api/data", "")
ASSIGN response = restProxy.Execute()
No auth errors, just empty. Checked the URL in Postman and it’s fine. Am I missing a header assignment?
You’re missing the headers. GetRESTProxy doesn’t inject auth automatically for custom endpoints. Add an Authorization header with a Bearer token from a previous action. Also check the Content-Type. If the endpoint expects JSON, set it explicitly.
ASSIGN headers = {"Authorization": "Bearer " + token, "Content-Type": "application/json"}
ASSIGN restProxy = GetRESTProxy("custom", "GET", "/api/data", "", headers)