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).
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.
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
"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
success: true
result: []
Moreover, I went through all Collaboration~Documents/Documents 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.