Retrieving workdoc field/block contents via the API

Hi,

I am trying to retrieve the contents of particular blocks in a workdoc using the API, I can successfully query a document as so:

query {
  docs (object_ids: XXXXXXXXXX, limit: 1) {
    blocks {
      id
      content
      doc_id
      
    }
  }
}

However, I cannot access the content of a table, for example, and have not been able to find documentation to figure it out (it may just be me and I missed it).

I would like to be able to programmatically retrieve content from a Monday workdoc. So far I have been querying the block property, but cannot move beyond listing the blockId’s below that - which doesn’t include the actual content within the return using the query above.

Could someone point me in the right direction? I had been reviewing Document blocks

Thanks.

1 Like

Hello there @acodez,

I will check about this specific use case with the team in charge of the docs and will let you know as soon as they reply :grin:

Cheers,
Matias

Hello again @acodez ,

I checked this with the team in charge of docs.

Currently the API supports getting all blocks of a doc. In the case of the cells of a table created within the UI, you will need to (from the UI) click on the cells before they are visible to the API because of how this is configured at the moment. This is if the block was created via the UI.

If the table is created via API then the content of each cell will be visible immediately without the need of clicking anywhere.

Cheers,
Matias