I retrieved a board item that has a column of type “doc”.
The value returned for this column was:
{
“files”: l
{
“name”: “…”,
“fileId”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,
“isImage”: “false”,
“fileType”: “MONDAY_DOC”,
“objectId”: 0123456789,
“createdAt”: 1701009184525,
“createdBy”: “12345678”,
“linkToFile”: “https://example.monday.com/docs/0123456789”
}
]
}
So, following the documentation at Document blocks, I thought that I would be able to quickly retrieve the blocks of this Monday Doc by performing the following query:
{
query {
docs (ids:0123456789) {
blocks {
id
type
content
}
}
}
}
But it didn’t work.
API returned empty array for Docs:
{
“data”: {
“docs”:
},
…
}
After many trials, I finally figured out that the doc id is not the object id returned for the board item. It’s the id displayed on the Monday Doc above the outline.
This is very confusing because the Docs and Document blocks queries look similar.
The difference is that the Docs query uses “object_ids” as argument while the second Document blocks query uses “ids” as argument (i.e. in this case the doc id, which is not the object id returned by the board item).
Docs:
query { docs (object_ids: 1234567) {…} }
Document blocks
query { docs (ids: 1234567) {…} }