Document toolboxDocument toolbox

Wiki API (Alpha)

Note: This feature is currently in Alpha and all functionality is not currently support.

Wiki REST

Wiki pages are currently not stand-alone objects, rather they are a component of another object such as an Entity, Competition or Evaluation.  Therefore, access to a wiki page is gated by its owner object

Note: WikiPages can be nested to created a hierarchy of sub-pages.  However, there can only be one root WikiPage per owner object, and all sub-pages are considered to be owned by the same object.

WikiPage

fieldDescription
idThe unique immutable identifier assigned to a wiki page when it is first created.  This is used
etagUsed for concurrency management.  Each time a WikiPage changes the etag will change.
createdByThe ID of the user that created the WikiPage
createdOnThe date when the WikiPage was  first created.
modifiedByThe ID of the user that last modified the wiki page.
modifiedOnThe data when the WikiPage was last modified.
titleThe main tile of the wiki page.
markdownThe main body of the wiki page is represented as markdown.
attachmentFileHandleIdsThe list of FileHandleIds that represent that this WikiPage's attachment files.
parentWikiIdSub-WikiPages are created by setting this to the ID of a parent WikiPage (null for root). Note: This is not the same as the owner of the WikiPage. 

WikiHeader

fieldDescription
idThe id of the wiki page.
titleThe title of the wiki page.
parentWikiIdThe ID of the parent wiki (null for root)

Note: All relative URLs in this document are assumed to point to be: https://repo-prod.sagebase.org/repo/v1.  The full URL will be provided whenever this is not the case.

Permission

The permissions required to perform any wiki related operation are tied to the permission of the owner object and the HTTP type. For example, if you  have CREATE permission on an Entity, then you can create a Wiki page for that entity.  Similarly, if you can EDIT an entity, then you can also edit any wiki page associated with the entity.  This means all REST call for wiki pages involve the owner object.

HTTP typeRequired Permission
POSTThe caller must have the CREATE permission on the owner object to perform this action.
GETThe caller must have the READ permission on the owner object to perform this action.
PUTThe caller must have the EDIT permission on the owner object to perform this action.
DELETEThe caller must have DELETE permission on the owner object to perform this action.

 

CRUD REST

URLHTTP typeDescription
/{ownertObjectType}/{ownerObjectId}/wikiPOSTUsed to create a new wiki page and assign it to an owner object.
/{ownertObjectType}/{ownerObjectId}/wikiheadertreeGETGet entire wiki tree as a list of WikiHeaders. The list is ordered first by parentWikiId and then by title.  This can be used to build a tree representation of wiki hierarchy for a given owner object.
/{ownertObjectType}/{ownerObjectId}/wikiGETGet the root wiki page associated with an object.
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}GETGet a wiki page by its ID.
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}PUTUsed to update a wiki.
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}DELETEUsed to delete a wiki page.

Attachments

Each wiki page has its own list of file attachments represented as FileHandleIds.  For more information on FileHandles see: FileHandle API.

URLHTTP typeDescription
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachment?fileName={attachmentFileName}GETAttempt to download the raw file attachment using the name of the attachment file instead of the FileHandleId.  Note: This call will result in a HTTP temporary redirect (307), to the real file URL if the caller is authorized to READ the owner object.
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachmentpreview?fileName={attachmentFileName}GETAttempt to download the preview file attachment using the name of the attachment file instead of the FileHandleId.  Note: This call will result in a HTTP temporary redirect (307), to the real file URL if the caller is authorized to READ the owner object.
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachmenthandlesGETGet the FileHandles for all attachments of the given WikiPage.  The resulting list will also include any PreviewFileHandles.

Planned Future API (not currently implemented)

URLHTTP typeDescription
/{ownertObjectType}/{ownerObjectId}/wikiGETGet the root WikiPage for an owner object.
https://file-prod.sagebase.org/file/v1/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachmentPOST (HTTP Multipart)Add an attachment file to a wiki using HTTP mutlipart POST.  Notice, the host for this call is a special file dedicated server.
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachment/{fileHandleId}GETAttempt to download the raw file attachment.  Note: This call will result in a HTTP temporary redirect (307), to the real file URL if the caller is authorized to READ the owner object.
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachmentPreview/{fileHandleId}GETAttempt to download the preview file that is automatically generated for all FileHandles. Note: This call will result in a HTTP temporary redirect (307), to the real file URL if the caller is authorized to READ the owner object.