Skip to main content
Answered

Trying to fetch articles but keep getting CORS

  • September 6, 2023
  • 1 reply
  • 348 views

Hello, I am trying to fetch all articles and I keep getting CORS error no matter what I try. I tried to set the headers as mentioned here https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Articles/listArticles/, adding also access allow control origin header but I can’t get the data. I get it in postman with no issue. What am I missing? Working with RTK Query.

Best answer by cameron.gumley

Hi @Veronika Machackova! Cam from the Intercom Support Engineering team here.

Our system blocks calls to the REST API from browsers any browser that uses CORS and web apps that attempt to make client-side calls (as RTK Query is designed to do). This has been implemented our Product and Security teams to prevent important and sensitive data from being exposed.

In this type of scenario, you would need to make the request on the server-side, then populate that on the client-side directly from your server (assuming that's an option for you) 👍

The client-side functions we have available are listed in our Javascript library, where the risk of exposing any customer-related data is minimized. Note, you can show a specific article using this JS snippet.

Let me know if that answers your question!

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+4
  • Intercom Team
  • 109 replies
  • Answer
  • September 8, 2023

Hi @Veronika Machackova! Cam from the Intercom Support Engineering team here.

Our system blocks calls to the REST API from browsers any browser that uses CORS and web apps that attempt to make client-side calls (as RTK Query is designed to do). This has been implemented our Product and Security teams to prevent important and sensitive data from being exposed.

In this type of scenario, you would need to make the request on the server-side, then populate that on the client-side directly from your server (assuming that's an option for you) 👍

The client-side functions we have available are listed in our Javascript library, where the risk of exposing any customer-related data is minimized. Note, you can show a specific article using this JS snippet.

Let me know if that answers your question!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings