-
Notifications
You must be signed in to change notification settings - Fork 8
Client server Document REST API
Andrea Peltrin edited this page Jun 8, 2022
·
2 revisions
Status: This is a draft document.
GET domain.com/d/documentId
Return the given serialized document, ready to be deserelized by the Elm client:
{
"schemaVersion": 4,
"lastUpdatedOn": 1652365136062,
"collapsedTreeItems": [
"322e5908-4f4f-46bd-a129-7064b9c3b9e7",
...
],
"viewport": { "tag": "Fluid", "args": [] },
"selectedNodeId": "e7aad29e-b21b-4ca8-87b8-8a9e42c3430b",
"root": {
...
}
}
Note: documentId
should not by guessable (use GUID or other url-compatible encoding like YT)
GET domain.com/u/userId
Return a list of document ID's:
[
{
"id": "SomeId",
"lastUpdatedOn": 1652365136062
},
...
]
We include the lastUpdatedOn
so we can convert it in something more readable (e.g."1 week ago") right in the document gallery section.
POST domain.com/d/new
...BODY...
Save a new document. Serve will reply with the new document URL.
PUT domain.com/d/documentId
...BODY...
Replace an exiting document with its new version.
Note: All operation requires a valid auth credentials to be sent.