API calls about Boards make no sense

I use the 2024-01 to get a board by name. How do I know this name? I see it in Monday. It is the name of my board. My interesting name is: MyCompany Dev WIP

GetMondayBoard.call(name: "MyCompany Dev WIP")

data returned from API call is:

[
  {"name"=>"Subitems of MyCompany Dev", "id"=>"6011889899"}, 
  {"name"=>"MyCompany Dev", "id"=>"6011889795"}, 
  {"name"=>"My Tasks", "id"=>"5909041240"}
]

So I am trying to get the ID of my board “MyCompany DEV WIP”. With that ID, I can continue to do magic. However, much to my confusion, hence this post, Monday API has other ideas. It is returning the above data, informing me there is no board by that name. I can see this! That is bad. The “truth” according to the API is that I have a board named MyCompany Dev which is most definitely not what I see in the Monday desktop view of things.

So it is one thing to be an adhoc data store, but how am I supposed to work with this? I know my board has a name, yet I cannot search for it by name. What is the secret sauce I am missing here?

You should be able to get the board ID directly for your board in your browser, then use it, if you are writing arbitrary code to work with your board. There is no way to query boards by name. Just return them all, and get their name and manually filter them. Just use the ID from the browser if you’re doing something of a fixed nature.

If you’re writing dynamic code that could work on many boards, then using webhooks or app integrations, you set those up to send you the board ID.

GetMondayBoard.call is not part of the API, its a function of some third party library. Here is an actual API query string for the API.

Name is always downstream for the ID.

{
   boards(ids: "123123123") {
     name
     id
   }
}

You haven’t shared the query you’re running, nor language you’re working in, or other libraries so it’s kind of a guess.

hi @dlazar

I don’t know where GetMondayBoard is implemented from and how this call uses the API. The monday API does not support a call to retrieve a board id by its name. The other way around works perfectly well (retrieve the board name given its id).

Where does GetMondayBoard comes from?

My GetMondayBoard is just a wrapper around this:

 query {
      boards(state: active, limit: 200) {
        name
        type
        id
      }    
    }

While I appreciate the sentiment that Monday does not support query by name, my point was, it stores text as the name of a board that differs from the browser. That is unsettling to say the least.

So I still remain puzzled, not on how to query Monday, but on just what is going on INSIDE Monday itself. Apples are not Oranges.

And yes, I am doing an automation between online business properties, and while I could theoretically hard-code IDs to get things done, that is like me in 1978 programming my Trash80 using Basic and doing GOTO calls. It is 2024.

Never mind… I see that if I just rely on the hard-coded value for the Board, I can get my groups and those match my expectations. Weird but true. The quirks of Monday API work!

The monday apps framework, whether for integrations (automations) or UI features provides a “context” which contains the relevant board ID. The webhooks created by API or manually in the UI send the board ID in their payloads as well.

Since you’re working outside of the apps framework, nor using a webhook integration to send item/column/group changes etc. to your code, you’re not being sent that board ID. That’s why you need to hard code the ID - instead of your board name (how would that be any different than the ID?)

With the workspace id (retrieve from workspace URL), you can use this query to obtain all the boards. Unfortunately it also provides “sub_items_board”, but you filter those out:

query {
boards(state: active, limit: 200, workspace_ids:12345678) {
name
type
id
}
}

I sampled for workspace ID in all my boards. Every single workspace ID is NULL.

Onto other things… I am going to try and listen for a click in Monday that then fires off a Webhook to my App. I read up on this a little, and found it most perplexing. There is no real security except in the sense that if I set a Webhook to fire in Monday, it will send a payload to my App endpoint, but I must retrieve a value from the header and echo it back to Monday.

I am paraphrasing. I am not sure that is true. I can’t wait to find out.