Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.  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.

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.

...

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}/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.

...

URLHTTP typeDescription
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.
https://repo-prod.sagebase.org/repo/v1/{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 READ the owner object.
https://repo-prod.sagebase.org/repo/v1/{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 READ the owner object.
https://repo-prod.sagebase.org/repo/v1/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachmentHandle/{fileHandleId}GETGet the FileHandle of an attachment.  The FileHandle includes basic metadata about the attachment file.
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachmentHandle/{fileHandleId}DELETEDelete a given FileHandle from a wiki page.