Which url to use for GraphQL calls? + Authentication

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 :sunny: :smile:

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

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’ }

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?

2 Likes

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!

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

1 Like

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.

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

hope this helps!

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.

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

Hi, thank you for the reply, Monday has the absolute best customer support :slight_smile: 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.

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