tomgoirand
(thomas goirand)
May 29, 2020, 11:50am
1
Hi there,
I am trying to figure how to get value out of the GraphQL V2 API. A bit tough for non-dev like me.
So far, I am trying to create a board from a template, which works, but Monday is not sending over the board_id. Only the account_id.
Do you have any idea how I could get this data?
{
"mutation": "{\n create_board(board_name: \TEST BOARD\", board_kind: public, template_id: 458010928){\n id\n }"
}
Hereby the output
dipro
(Dipro Bhowmik)
May 29, 2020, 4:37pm
2
Hey @tomgoirand – looks like you’ve got some errors in your HTTP request.
At first glance, looks like you’re missing the preceding quotation in the “board_name” field:
You can see the exact errors by drilling into the “errors” key in the output:
Do let me know if that helps.
tomgoirand
(thomas goirand)
May 29, 2020, 6:01pm
3
Hey thanks for your help!
I did update the request as you advised. Here is the query but I keep getting a 400 error code.
{
"mutation": "{\n create_board(board_name: "\Déploiement - TEST CORP\", board_kind: public, template_id: 458010928){\n id\n }"
}
dipro
(Dipro Bhowmik)
May 29, 2020, 6:52pm
4
Hey @tomgoirand – try adding the backslash before (not after) the quote, and change the “mutation” keyword to “query”. Like so:
{
"query": "mutation {\n create_board(board_name: \"Déploiement - TEST CORP\", board_kind: public, template_id: 458010928){\n id\n }"
}
tomgoirand
(thomas goirand)
June 1, 2020, 8:42am
5
Hello,
Thank you. I now have a “no query string was present” error. Should I use it to put the API credentials rather than headers?
dipro
(Dipro Bhowmik)
June 4, 2020, 11:37pm
6
Hey @tomgoirand – apologies, I missed something in your last message. You should use the key “query” in the body of the request and add the mutation keyword inside the mutation itself, like so:
{
"query": "mutation{\n create_board(board_name: \"Déploiement - TEST CORP\", board_kind: public, template_id: 458010928){\n id\n }"
}
I’ll go ahead and correct my previous post as well!
tomgoirand
(thomas goirand)
June 5, 2020, 6:58am
7
Hey, I think we are close! Just tried your updated code, but I face a new error code which is not documented by Monday. Can you help figure out this issue?
{
"errors": [
{
"message": "Unexpected end of document",
"locations": []
}
],
"account_id": 5038486
}
tomgoirand
(thomas goirand)
June 5, 2020, 9:36am
8
Good finally! A bracket was missing at the end of the query.