GET https://{url}.zendesk.com/api/v2/help_center/users/15344523818135/articles net::ERR_FAILED 200



Data ultimo post: 19 giu 2023

Facing net::ERR_FAILED 200 issue in the API.

What is the solution for this?


0

8

8 commenti

      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.

      0


      im calling the API from an external website Pulkit Pandey

      can you please suggest where can i take the token, and how to use in the api.

      give me an example.

      0


      Hi Sitaram Kudireddy

      Are you using the above approach within your help center theme or are you calling the API from an external website?

       

      Thank You

      Pulkit

      Team Diziana

      0


      const response = await axios.get('https://example.zendesk.com/api/v2/help_center/articles', {
      headers: {
      Authorization:`Bearer ${zendeskToken}`,
      'Content-Type':'application/json',
      Accept:'application/json',
      },
      })
       
      this is with api token. but not working

      0


      const response = await axios.get('https://example.zendesk.com/api/v2/help_center/articles', {
      headers: {
      Authorization:`Basic ${btoa(`${username}:${password}`)
      }`,
      'Content-Type':'application/json',
      Accept:'application/json',
      },
      })
      is this correct way?

      0


      Hi Sitaram Kudireddy

      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? 

       

      Thank You 

      Pulkit

      Team Diziana

      0


      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
      }

      0


      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

      0


      Accedi per lasciare un commento.

      Non hai trovato quello che cerchi?

      Nuovo post