Skip to main content
Solved

pipefy api


zevi
  • New Member
  • 4 replies

Hi I'm trying to use the pipefy API and every time I send the request the response I get is 
        
       Access to XMLHttpRequest at 'https://api.pipefy.com/' from origin 'https://www.mywebsite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I would appreciate if you could take your time to help me 

thanks 

Best answer by genietim

Hi @zevi 

 

The enpoint (URL) should be https://api.pipefy.com/graphql , so something along the lines of

 

var url = "https://api.pipefy.com/graphql";

var xhr = new XMLHttpRequest();
xhr.open("POST", url);

xhr.setRequestHeader("Authorization", "Bearer YourTokenHere");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

var data = `query {
  cards(pipe_id:1234567) {
    edges {
      node {
        fields {
          name
          value
        } 
      }
    }
  }
}`;

xhr.send(data);

 

should work.

The suggestion of Lais was for you to visit the suggested URL in the browser, as there, you can check whether the issue is the query (→ does not work there either) or the rest of your code (if the query works at https://app.pipefy.com/graphiql ).

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

3 replies

Lais Laudari

Hi @zevi, how are you?

Are you trying on https://app.pipefy.com/graphiql ? 

Could you share the query/mutation you are using, please?

Regards,


zevi
  • Author
  • New Member
  • 4 replies
  • June 27, 2022

@lais-laudari thanks for your reply I copied down here the code I'm using 

 

 

var url = "https://app.pipefy.com/graphiql";

var xhr = new XMLHttpRequest();
xhr.open("POST", url);

xhr.setRequestHeader("Authorization", "here i put my auth token");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

var data = `{
  cards(pipe_id:1234567) {
    edges {
      node {
        fields {
          name
          value
        } 
         
        
      }
    }
  }
}`;

xhr.send(data);


genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • Answer
  • June 28, 2022

Hi @zevi 

 

The enpoint (URL) should be https://api.pipefy.com/graphql , so something along the lines of

 

var url = "https://api.pipefy.com/graphql";

var xhr = new XMLHttpRequest();
xhr.open("POST", url);

xhr.setRequestHeader("Authorization", "Bearer YourTokenHere");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

var data = `query {
  cards(pipe_id:1234567) {
    edges {
      node {
        fields {
          name
          value
        } 
      }
    }
  }
}`;

xhr.send(data);

 

should work.

The suggestion of Lais was for you to visit the suggested URL in the browser, as there, you can check whether the issue is the query (→ does not work there either) or the rest of your code (if the query works at https://app.pipefy.com/graphiql ).


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