...
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.
...
field | Description |
---|---|
id | The id of the wiki page. |
title | The title of the wiki page. |
parentWikiId | The 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 type | Required Permission |
---|---|
POST | The caller must have the CREATE permission on the owner object to perform this action. |
GET | The caller must have the READ permission on the owner object to perform this action. |
PUT | The caller must have the EDIT permission on the owner object to perform this action. |
DELETE | The caller must have DELETE permission on the owner object to perform this action. |
CRUD REST
URL | HTTP type | Description |
---|---|---|
/{ownertObjectType}/{ownerObjectId}/wiki | POST | Used to create a new wiki page and assign it to an owner object. |
/{ownertObjectType}/{ownerObjectId}/wikiHeaderTree | GET | Get 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} | GET | Get a wiki page by its ID. |
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId} | PUT | Used to update a wiki. |
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId} | DELETE | Used to delete a wiki page. |
...
URL | HTTP type | Description |
---|---|---|
https://file-prod.sagebase.org/file/v1/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachment | POST (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} | GET | Attempt 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} | GET | Attempt 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} | GET | Get the FileHandle of an attachment. The FileHandle includes basic metadata about the attachment file. |
/{ownertObjectType}/{ownerObjectId}/wiki/{wikiId}/attachmentHandle/{fileHandleId} | DELETE | Delete a given FileHandle from a wiki page. |