User Tools

Site Tools


en:outskirts:mages-peaks:authoring-api

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 as en:hand-that-crafts:mornedoc-house

Returns a JSON array of all the attachments to this page, with for each:

  • id: the attachment ID, such as en:hand-that-crafts:mornedoc-house:photo_5-3-3-43_1.jpg
  • file: the filename of the attachment, such as photo_5-3-3-43_1.jpg
  • size: the file size in bytes
  • mtime: 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 a en:hand-that-crafts:mornedoc-house
  • type: Must be jsonattrs
  • data: 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 as en:hand-that-crafts:mornedoc-house
  • type: Must be jsonattrs

Returns the JSON object in the body.

en/outskirts/mages-peaks/authoring-api.txt · Last modified: 2024/10/28 08:00 by 127.0.0.1