Table of Contents
Laelith Authoring API
This API is exposed by the Laelith-Api server, as described in The Laelith API. It supports back-end services for Laelith Authoring features.
As a guiding principle for Scenarios, Adventures and other authored contents, it is wished to store as much data as possible in the Laelith Wiki – where it can be easily related to other contents and manipulated. The first set of Authoring API endpoints allow to associate arbitrary complex attributes to a Wiki page – this is realised by providing the capability to store/retrieve a JSON object associated with a page.
Authoring API Endpoints for manipulating data associated with a Wiki page
GET /wikiversion
The main interest of this endpoint is to validate the availability of the API and the access to the Wiki.
Arguments:
none
Returns a JSON object:
{version: “Release 2022-07-31a \”Igor\“”}
GET /listattachments?ownerid=<PageID>
Returns the list of all attachments of the specified Wiki page.
Arguments:
ownerid: the Wiki page's ID such asen:hand-that-crafts:mornedoc-house
Returns a JSON array of all the attachments to this page, with for each:
id: the attachment ID, such asen:hand-that-crafts:mornedoc-house:photo_5-3-3-43_1.jpgfile: the filename of the attachment, such asphoto_5-3-3-43_1.jpgsize: the file size in bytesmtime: the file's last modification date, in millis since 1/1/70
POST /putjsonattachment
Associates a JSON object with a Wiki page. If a JSON object was previously associated with the same page, it is replaced.
Arguments (in a JSON object in body):
ownerid: The ID of the owner page, such aen:hand-that-crafts:mornedoc-housetype: Must bejsonattrsdata: A JSON object to be associated with this page.
Returns a JSON object with {result: “ok” or “FAILED”}. May also return a 400 status in case of errors.
GET /getjsonattachment?ownerid=<PageID>&type=jsonattrs
Retrieves the JSON object associated with a Wiki page (404 status if it does not exist).
Arguments:
ownerid: the Wiki page's ID such asen:hand-that-crafts:mornedoc-housetype: Must bejsonattrs
Returns the JSON object in the body.
