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 ).