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/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.