Skip to main content

Which url to use for GraphQL calls? + Authentication

  • July 10, 2019
  • 11 replies
  • 4396 views

kevinmarchese

Hi,

I’m just wondering which url would I call to make a query or mutation? Also is there instructions on how to authenticate the call? Perviously in v1 it would have gone at the end of the url.

This question is on my list of things to understand, or needing to figure out, while transitioning to graph QL from Rest. However, If anyone wants to show a quick example, that would be always ☀️ 😀

This topic has been closed for replies.

11 replies

kevinmarchese
  • Author
  • Participating Frequently
  • July 10, 2019

so the url would be api.monday.com/v2 and then just add the token to the header? is it that easy?


kevinmarchese
  • Author
  • Participating Frequently
  • July 10, 2019

This seems to be the way to set up Axios in node.js to get back data.

axios({ url: ‘https://api.monday.com/v2’, headers: {
Authorization: 'Bearer ’ + process.env.mondayToken
},
method: ‘get’,
data: {
query: query { boards(ids: ID_HERE) { description } }
}
}).then((result) => {
console.log(result.data.data.boards[0])

})
.catch(function (error) {
console.log(error)
});
})
}

log returns { description: ‘post to monday.com’ }


Ayelet
Forum|alt.badge.img
  • monday.com Team Member
  • July 11, 2019

Hey,
This is exactly the way to get data from our GraphQL API. Send a POST request to https://api.monday.com/v2 with the “Authorization” header containing your API v2 token and the request body containing your query/mutation text.
Did it work for you with Axios?


kevinmarchese
  • Author
  • Participating Frequently
  • July 11, 2019

yes, it did work well. So now I can GET, Working on POST or Mutation correct steps. get parsing errors maybe because I’m not doing the stringify wrong, but where there is a will there is a way!


dipro
Forum|alt.badge.img
  • Leader
  • July 16, 2019

There certainly is Kevin! Keep posting if you have any questions 🙂


  • New Participant
  • August 5, 2019

Do we have to do any manipulation of the API v2 documentation? used above instructions in integromat HTTP module, but would not allow for querying using just the given code.


Ayelet
Forum|alt.badge.img
  • monday.com Team Member
  • August 5, 2019

hey @fsbass, check out this post about using integromat HTTP module:

hope this helps!


  • New Participant
  • August 5, 2019

I keep receiving “500 Internal Server Error If you are the administrator of this website, then please read this web application’s log file and/or the web server’s log file to find out what went wrong”. No idea why. I used my v2 API token in the header.


dipro
Forum|alt.badge.img
  • Leader
  • August 5, 2019

Hey @fsbass – can you send us the query you’re making to the server? Would love to see if we can spot any errors.


  • New Participant
  • August 7, 2019

Hi, thank you for the reply, Monday has the absolute best customer support 🙂 I used the query code from the post recommended by Ayelet, filling in my own data for the IDs and my v2 API token in the Authorization Header. I feel like it has to do with an authentication error but I know close to nothing about any of this as I am a non-dev. Any help would be greatly appreciated.


dipro
Forum|alt.badge.img
  • Leader
  • October 3, 2019

Hey @fsbass – I’m so sorry for the super late response on this! This thread slipped through the cracks.

If this is still relevant, can you send us an email at support@monday.com and reference this thread? I think we’ll be able to figure this out over email/a screenshare much more quickly.

Cheers,
Dipro