Metadata API
Metadata API
When using the API there are 2 new API endpoints related to metadata under a document or a page there is a /metadata endpoint. These endpoints support GET, POST, PATCH and DELETE HTTP operations.
- GET: Returns the current metadata for the page or document.
- POST: Updates the current metadata for the page or document.
- Should contain the following keys:
- metadata: The new json string you want to set as metadata
- merge_strategy: (replace|merge) Indicate if you want the new metadata to replace existing metadata or be merged with it. (Defaults to replace)
- Should contain the following keys:
- PATCH: Updates the current metadata for the page or document, this is the same as POST except that it does not accept the merge_strategy and always uses merge.
- DELETE: Remove the existing metadata from this page or document.
Note: that readonly metadata cannot be changed using the API endpoints. Any readonly metadata specified in POST or PATCH requests will be ignored.
Note: Ensure that you understand the structure of metadata before updating, especially tags are not what you might expect (they're not simple strings!) Structure of Metadata
Metadata in the Page Editor
One of the key use cases for metadata is to replace part of a pages content from the page or document metadata (For example displaying the date a page was last updated). When editing a page there is now an additional sidebar panel which displays your document and page metadata:
Hovering over any value will display a copy button which can be used to copy a special template value which can then be pasted anywhere in the page editor and when the page is viewed the value will be inserted dynamically.
Example of the page editor with the template value:
Preview of the same page:
Unless otherwise indicated in the Overview page of this WIKI the information contained within this space is Classified according to the /wiki/spaces/ISMS/pages/739344530 as |
INTERNAL |