# Retrieving document content

**URL:** <https://community.fibery.io/t/retrieving-document-content/4772>\
**Category:** API & Programming\
**Created:** [July 10, 2023, 8:38pm UTC](https://community.fibery.io/t/retrieving-document-content/4772 "2023-07-10T20:38:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![omega](https://avatars.discourse-cdn.com/v4/letter/o/a6a055/32.png) [@omega](https://community.fibery.io/u/omega)\
**Post date:** [July 10, 2023, 8:38pm UTC](https://community.fibery.io/t/retrieving-document-content/4772/1 "2023-07-10T20:38:13Z")

</div>

I am trying to retrieve the content of a document via `api/documents` endpoint as per [Select rich text Field](https://api.fibery.io/?shell#select-rich-text-field). All I am getting is

```auto
{"secret":"<requested document guid>","content":"<p data-guid=\"1c5882ad-b588-4f58-95cd-6f7fbdb18a9b\"></p>"}

```

The same `data-guid` seems to be returned for any document. What is it and how do I get the actual content?

---

<div class="post-metadata">

**Author:** ![Viktar\_Zhuk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/viktar_zhuk/32/1934_2.png) [@Viktar\_Zhuk](https://community.fibery.io/u/Viktar_Zhuk)\
**Post date:** [July 11, 2023, 10:07am UTC](https://community.fibery.io/t/retrieving-document-content/4772/2 "2023-07-11T10:07:02Z")

</div>

Hello,  
It is a default response even if document is not found you’ll get empty paragraph.

Please make sure you pass correct secret uuid as a part of the URL.

Suppose you’ve got an Entity with Description field via fibery.entity/query and the result looks like

```auto
{
  "fibery/id": "c1ff9530-e57a-44af-8769-f59558d8672a",
  "Feature/Description": {
    "fibery/id": "ddff9530-e57a-400f-8769-f59558d86444", 
    "Collaboration~Documents/secret": "79a5d180-b9b1-41e1-82a5-397a7770ca30"
  },
}

```

You should pass into /api/documents the value of `Collaboration~Documents/secret`

Hope this helps

---

<div class="post-metadata">

**Author:** ![omega](https://avatars.discourse-cdn.com/v4/letter/o/a6a055/32.png) [@omega](https://community.fibery.io/u/omega)\
**Post date:** [July 11, 2023, 5:19pm UTC](https://community.fibery.io/t/retrieving-document-content/4772/3 "2023-07-11T17:19:39Z")

</div>

Thanks for reaching back.

I find all this very confusing. To begin with, I referred to API docs expecting to find a ready answer on how to retrieve a document. Much to my surprise, Document doesn’t exist there as a concept (while it obviously exists in UI). I had to Ctrl-F through the lengthy page to find out that content-centric operations are buried down within “rich text Field”. Considering the use case, why should one care about such technical internals at all? The task is to get document content by id, as simple as that. While the endpoint is definitely simple, it seems (based on your reply) to come along with a clumsy prerequisite protocol. Then goes the “magic” with `fibery/secret`. Come on, didn’t you think to come up with some self-explaining name (let alone a meaningful concept)? In the end, after a few more attempts I’m still unable to get the content of a single document (see below on that).

> [@Viktar\_Zhuk](#):
>
> It is a default response even if document is not found you’ll get empty paragraph.

This is important and useful information. However, I can’t believe one can consider it a good API pattern. In any case, if you decide to go with something subtle like this, it won’t hurt to put a big warning in the docs.

> [@Viktar\_Zhuk](#):
>
> Suppose you’ve got an Entity with Description field via fibery.entity/query

I think it’s a shining example of cognitive disconnect that API brings as concerns documents.

User: “How do I get a document?”  
Developer: “Start with an entity.”  
User: “Entity? What the freaking entity?”

I don’t have an entity (whereof I am aware). After reading your direction my first thought was: “Alright, as long as I am dealing with magic LISPy database, I should obtain secret id somehow”. So I fired

```auto
"query": {
   "q/from": "Collaboration~Documents/Document",
   "q/select": ["fibery/id", "Collaboration~Documents/secret"], 
   "q/where": ["=", ["fibery/id"], "$id"],
   "q/limit": 1
},
"params": { "$id": "<my document id>" }

```

(I love these secret monikers `Collaboration~Documents/Document` and `Collaboration~Documents/secret`. No, in fact I don’t. Not in API at least).

I got

```auto
success: true
result: []

```

Moreover, I went through all `Collaboration~Documents/Document`s returned by the query API. Nope. Target document’s id is not in there. It suggests that the document is not of `Collaboration~Documents/Document` breed. This leaves me wondering what breed it is and how can I get to its content.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 11, 2023, 7:05pm UTC](https://community.fibery.io/t/retrieving-document-content/4772/4 "2023-07-11T19:05:48Z")

</div>

It’s fair that the documentation for the API is not optimal, but with limited resources, the Fibery team is focussing on implementing stuff/writing guides which benefit the broadest subset of users, and API users are in the minority (and are often more self-sufficient).

Unfortunately, the term ‘document’ can actually mean different things to different people in different contexts.  
It can be a document view (an item in the left menu, in a specific space/folder), it can be a rich-text field (of an entity), or it can be one of a set of documents that ‘belong’ to an entity (attached via the document field)

(and possibly even something else entirely, but let’s not go there!)

I think @Viktar_Zhuk assumed you meant the second type given that you wrote

> [@omega](#):
>
> trying to retrieve the content of a document via `api/documents` endpoint as per [Select rich text Field](https://api.fibery.io/?shell#select-rich-text-field)

whereas it seems you probably meant something else, based on this:

> [@omega](#):
>
> I don’t have an entity (whereof I am aware).

…and to complicate matters, the majority of the content of [the main API page](https://api.fibery.io) relates to the ‘commands’ API (  
https://YOUR\_ACCOUNT.fibery.io/api/commands) with only a little bit about ‘views’ and ‘documents’ API calls.

Anyway, just to check, in the hope of figuring things out, where are you getting the document Id from?

> [@omega](#):
>
> `"<my document id>" `

---

<div class="post-metadata">

**Author:** ![omega](https://avatars.discourse-cdn.com/v4/letter/o/a6a055/32.png) [@omega](https://community.fibery.io/u/omega)\
**Post date:** [July 11, 2023, 7:28pm UTC](https://community.fibery.io/t/retrieving-document-content/4772/5 "2023-07-11T19:28:54Z")

</div>

> [@Chr1sG](#):
>
> It’s fair that the documentation for the API is not optimal, but with limited resources, the Fibery team is focussing on implementing stuff/writing guides which benefit the broadest subset of users, and API users are in the minority (and are often more self-sufficient).

Just for the context: I am self-sufficient (xx years of coding and former tech lead). I still can’t wrap my head around a basic task. I’m not expecting the documentation to be optimal. It shouldn’t be confusing in the first place.

> [@Chr1sG](#):
>
> Unfortunately, the term ‘document’ can actually mean different things to different people in different contexts.

I find this very unfortunate for such a technical subject as API.

> [@Chr1sG](#):
>
> I think @Viktar_Zhuk assumed you meant the second type given you wrote

I ended up with rich text field because it is the only place in the documentation that mentions documents.

> [@Chr1sG](#):
>
> where are you getting the document Id from?

“Press Alt to see UUID” in the document toolbar.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 11, 2023, 8:09pm UTC](https://community.fibery.io/t/retrieving-document-content/4772/6 "2023-07-11T20:09:18Z")

</div>

> [@omega](#):
>
> > [@Chr1sG](#):
> >
> > Unfortunately, the term ‘document’ can actually mean different things to different people in different contexts.
> 
> I find this very unfortunate for such a technical subject as API.

Actually, a document has a very strict definition from a technical perspective, it’s just that it’s used in many various different places, and may be named otherwise when seen from a ‘normal’ user’s perspective.

---

<div class="post-metadata">

**Author:** ![Viktar\_Zhuk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/viktar_zhuk/32/1934_2.png) [@Viktar\_Zhuk](https://community.fibery.io/u/Viktar_Zhuk)\
**Post date:** [July 12, 2023, 7:48am UTC](https://community.fibery.io/t/retrieving-document-content/4772/7 "2023-07-12T07:48:52Z")

</div>

Hello,  
You haven’t find it in the api description just because work with Documents View doesn’t has a public api yet. You may get a sneak pick here in the user guide [. | Fibery](https://the.fibery.io/@public/User_Guide/Guide/API---FAQ-179/anchor=How-to-work-with-Documents--c1401b93-73e5-4f91-a047-3d8403d41198) ( `How to work with Documents?` section ).  
We do not guarantee that API doesn’t change some day.

---

<div class="post-metadata">

**Author:** ![omega](https://avatars.discourse-cdn.com/v4/letter/o/a6a055/32.png) [@omega](https://community.fibery.io/u/omega)\
**Post date:** [July 12, 2023, 9:14pm UTC](https://community.fibery.io/t/retrieving-document-content/4772/8 "2023-07-12T21:14:51Z")

</div>

> [@Viktar\_Zhuk](#):
>
> Documents View doesn’t has a public api yet

Thanks, this explains a lot.

---

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [August 30, 2023, 8:55pm UTC](https://community.fibery.io/t/retrieving-document-content/4772/9 "2023-08-30T20:55:18Z")

</div>

For those that find this post trying to retrieve Document view content using the API let me make it really easy for you:

```auto
import requests
import os

# How to work with Documents views in Fibery API
# Note that as of 2023-08-23 this API is still undocumented and likely to change in the future. See also:
# https://the.fibery.io/@public/User_Guide/Guide/API---FAQ-179/anchor=How-to-work-with-Documents--c1401b93-73e5-4f91-a047-3d8403d41198
# https://community.fibery.io/t/retrieving-document-content/4772

# 1) Retrieve the document secret of the corresponding collaborative document.

# Base URL and headers
BASE_URL = 'https://YOUR_ACCOUNT.fibery.io/api'
HEADERS = {
    'Authorization': f'Token {os.getenv("FIBERY_TOKEN")}',
    'Content-Type': 'application/json',
}

# Data for the request
# The publicId of a document can be obtained from the URL of the document view in Fibery
# https://ecomanalyticsco.fibery.io/FAQs/About-Us-123 (where 123 is the public id of the document view)
query_payload = {
    "jsonrpc": "2.0",
    "method": "query-views",
    "params": {
        "filter": {
            "publicIds": ["123"]
        }
    }
}

# Make the request, get the document secret uuid
response = requests.post(f'{BASE_URL}/views/json-rpc', headers=HEADERS, json=query_payload)
document_secret = response.json()['result'][0]['fibery/meta']['documentSecret']

# 2) Retrieve the document using the document secret.
# multiple formats are available: html, md (Markdown), json
# see also: https://api.fibery.io/?shell#select-fields
document_response = requests.get(f'{BASE_URL}/documents/{document_secret}?format=md', headers=HEADERS)
document_data = document_response.json()

# Print the document content
print(document_data['content'])

```

---

<div class="post-metadata">

**Author:** ![helloitse](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/helloitse/32/498_2.png) [@helloitse](https://community.fibery.io/u/helloitse)\
**Post date:** [February 17, 2026, 7:47pm UTC](https://community.fibery.io/t/retrieving-document-content/4772/10 "2026-02-17T19:47:27Z")

</div>

Okay, so the Fibery MCP also doesn’t support accessing document views.  
It has been 5 years and I never knew about this limitation, but I think that this should be prominently featured in the docs re: views vs entities.

I don’t have much value for docs I can’t extract via API or interact with via MCP so… this sucks.

---

<div class="post-metadata">

**Author:** ![mdubakov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mdubakov/32/10_2.png) [@mdubakov](https://community.fibery.io/u/mdubakov)\
**Post date:** [March 23, 2026, 9:39am UTC](https://community.fibery.io/t/retrieving-document-content/4772/11 "2026-03-23T09:39:46Z")

</div>

> [@helloitse](#):
>
> Okay, so the Fibery MCP also doesn’t support accessing document views.

Support is added in latest release, now MCP Server can find document and retrieve the content

 ![Screenshot 2026-03-23 at 11.39.37 AM](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/4/47bbe6b4f2c8e13f4c4df626d407786b416833b2.png)
