User Tools

Site Tools


en:outskirts:mages-peaks:authoring-api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:outskirts:mages-peaks:authoring-api [2023/11/12 21:30] – removed - external edit (Unknown date) 127.0.0.1en:outskirts:mages-peaks:authoring-api [2024/10/28 08:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Laelith Authoring API ======
 +
 +This API is exposed by the Laelith-Api server, as described in [[en:outskirts:mages-peaks:api|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.
 +
 +