To resolve the 'error is not a proxyable URI' in Zendesk, you need to adjust your API request settings. The default behavior ofclient.request
sends requests through Zendesk's proxy layer, which can result in this error. To bypass this, you should setcors: true
in your request options object. This allows the request to bypass the proxy layer, enabling successful communication between different Zendesk accounts.
Here's a quick example of how to set up your request:
function newRequest(){ var options = { url: 'https://subdomain.zendesk.com/api/v2/...', headers: { "Authorization": "Bearer OAUTH_TOKEN"}, type: 'POST', data: JSON.stringify({my:"json", values:"go here"}), contentType: "application/json", cors: true } client.request(options).then( function(response) { console.log(response); }); }
For more details, you can refer to the originalZendesk help article.
CORS plays a crucial role in Zendesk API requests, especially when requests originate from the client-side. Each Zendesk API endpoint implements CORS, which means that client-side requests will fail unless OAuth is used. If you're only reading data…
To securely write data to another Zendesk API, consider using server-side solutions. When writing data (PUT, POST) from a client-side app, the OAuth token is exposed in network traffic, which is not secure. Server-side solutions allow you to handle…
Secure settings are generally used to prevent exposing sensitive information like OAuth tokens. However, for cross-account API requests in Zendesk, secure settings are not applicable. This is because they require the request to go through Zendesk's…