New Chat Widget Customisations
Facing net::ERR_FAILED 200 issue in the API.
What is the solution for this?
Hi Sitaram Kudireddy
The API is working fine and giving the data based on the User ID, below is the code which I am using, please give a try to the below code.
$.getJSON('/api/v2/help_center/users/361093799539/articles', function(json_data){ console.log(json_data); });
Let me know if it solves your issue
Thank You
Pulkit
Team Diziana
https://example.zendesk.com/hc/restricted?return_to=https%3A%2F%2Fexample.zendesk.com%2Fhc%2Fapi%2Fv2%2Farticles&locale=en-us
here im facing the issue.
{ "message": "Network Error", "name": "AxiosError", "stack": "AxiosError: Network Error\n at XMLHttpRequest.handleError (http://localhost:3000/static/js/bundle.js:469408:14)", "config": { "transitional": { "silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false }, "adapter": [ "xhr", "http" ], "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 0, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "maxBodyLength": -1, "env": {}, "headers": { "Accept": "application/json", "Authorization": "Basic xexampleexampleexampleexampleexampleexampleexampleexampleexampleexampleexampleexampleexampleexampleexampleexampleexampleexample==" }, "method": "get", "url": "https://example.zendesk.com/api/v2/help_center/articles" }, "code": "ERR_NETWORK", "status": null}
The link you shared above Is restricted to the signed-in user only so I can't look into the issue for now.
Can you please share how you call the API on your js file?
Are you using the above approach within your help center theme or are you calling the API from an external website?
im calling the API from an external website @pulkit12
can you please suggest where can i take the token, and how to use in the api.
give me an example.
Access to XMLHttpRequest at 'https://xcubelabs6968.zendesk.com/hc/restricted?return_to=https%3A%2F%2Fxcubelabs6968.zendesk.com%2Fhc%2Fapi%2Fv2%2Farticles&locale=en-us' (redirected from 'https://xcubelabs6968.zendesk.com/api/v2/help_center/articles') from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.