Create a board API route V2 - how to get the board id?

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

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.

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

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

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?

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!

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
}

Good finally! A bracket was missing at the end of the query.