Skip to main content
Solved

problem with GraphQL auth | NodeJS


rdavidsc

Hi there:

I’m trying to make querys from a server using NodeJS and always get error 401 “you are not authorized to access this page” 

 

const url = 'https://api.pipefy.com/graphql';

const options = {

method: 'POST',

headers: {

Authorization: '***MY_TOKEN***',

'Content-Type': 'application/json'

},

body: JSON.stringify({query: '{ me { name } }'})

}

 

 The thing is, I'm using the example in the documentation but it doesn't work. What I am doing wrong?

 

 

Best answer by Mayara Rasini

Hi! 
You need to use Bearer before your token, like this:
"Authorization": "Bearer YOUR_TOKEN", "Content-Type": "application/json"

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

2 replies

Mayara Rasini
Pipefy Staff
  • Pipefy Staff
  • 2 replies
  • Answer
  • May 12, 2021

Hi! 
You need to use Bearer before your token, like this:
"Authorization": "Bearer YOUR_TOKEN", "Content-Type": "application/json"


rdavidsc
  • Author
  • New Member
  • 1 reply
  • May 12, 2021

Thanks Mayara. It solves the issue.

 

I think in the reference is not clear enough:

https://developers.pipefy.com/reference#graphql-endpoint

 

Thanks! Now I’m starting my integration.


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