Convert content body
POST {{baseUrl}}/api/contentbody/convert/:to?expand=<string>&expand=<string>&spaceKeyContext=<string>&contentIdContext=<string>&embeddedContentRender=current
Converts a content body from one format to another format.
Supported conversions:
- storage: view, exportview, styledview, editor
- editor: storage
- view: none
- export_view: none
- styled_view: none
Permissions required: If request specifies 'contentIdContext', 'View' permission for the space, and permission to view the content.
Request Params
| Key | Datatype | Required | Description |
|---|---|---|---|
expand | string | A multi-value parameter indicating which properties of the content to expand. |
childTypes.allreturns whether the content has attachments, comments, or child pages. Use this if you only need to check whether the content has children of a particular type.childTypes.attachmentreturns whether the content has attachments.childTypes.commentreturns whether the content has comments.childTypes.pagereturns whether the content has child pages.containerreturns the space that the content is in. This is the same as the information returned by Get space.metadata.currentuserreturns information about the current user in relation to the content, including when they last viewed it, modified it, contributed to it, or added it as a favorite.metadata.propertiesreturns content properties that have been set via the Confluence REST API.metadata.labelsreturns the labels that have been added to the content.metadata.frontendthis property is only used by Atlassian.operationsreturns the operations for the content, which are used when setting permissions.children.pagereturns pages that are descendants at the level immediately below the content.children.attachmentreturns all attachments for the content.children.commentreturns all comments on the content.restrictions.read.restrictions.userreturns the users that have permission to read the content.restrictions.read.restrictions.groupreturns the groups that have permission to read the content. Note that this may return deleted groups, because deleting a group doesn't remove associated restrictions.restrictions.update.restrictions.userreturns the users that have permission to update the content.restrictions.update.restrictions.groupreturns the groups that have permission to update the content. Note that this may return deleted groups because deleting a group doesn't remove associated restrictions.historyreturns the history of the content, including the date it was created.history.lastUpdatedreturns information about the most recent update of the content, including who updated it and when it was updated.history.previousVersionreturns information about the update prior to the current content update.history.contributorsreturns all of the users who have contributed to the content.history.nextVersionreturns information about the update after to the current content update.ancestorsreturns the parent page, if the content is a page.bodyreturns the body of the content in different formats, including the editor format, view format, and export format.versionreturns information about the most recent update of the content, including who updated it and when it was updated.descendants.pagereturns pages that are descendants at any level below the content.descendants.attachmentreturns all attachments for the content, same aschildren.attachment.descendants.commentreturns all comments on the content, same aschildren.comment.spacereturns the space that the content is in. This is the same as the information returned by Get space.
In addition, the following comment-specific expansions can be used:
-
extensions.inlinePropertiesreturns inline comment-specific properties. -
extensions.resolutionreturns the resolution status of each comment. | |expand| string | | A multi-value parameter indicating which properties of the content to expand. -
childTypes.allreturns whether the content has attachments, comments, or child pages. Use this if you only need to check whether the content has children of a particular type. -
childTypes.attachmentreturns whether the content has attachments. -
childTypes.commentreturns whether the content has comments. -
childTypes.pagereturns whether the content has child pages. -
containerreturns the space that the content is in. This is the same as the information returned by Get space. -
metadata.currentuserreturns information about the current user in relation to the content, including when they last viewed it, modified it, contributed to it, or added it as a favorite. -
metadata.propertiesreturns content properties that have been set via the Confluence REST API. -
metadata.labelsreturns the labels that have been added to the content. -
metadata.frontendthis property is only used by Atlassian. -
operationsreturns the operations for the content, which are used when setting permissions. -
children.pagereturns pages that are descendants at the level immediately below the content. -
children.attachmentreturns all attachments for the content. -
children.commentreturns all comments on the content. -
restrictions.read.restrictions.userreturns the users that have permission to read the content. -
restrictions.read.restrictions.groupreturns the groups that have permission to read the content. Note that this may return deleted groups, because deleting a group doesn't remove associated restrictions. -
restrictions.update.restrictions.userreturns the users that have permission to update the content. -
restrictions.update.restrictions.groupreturns the groups that have permission to update the content. Note that this may return deleted groups because deleting a group doesn't remove associated restrictions. -
historyreturns the history of the content, including the date it was created. -
history.lastUpdatedreturns information about the most recent update of the content, including who updated it and when it was updated. -
history.previousVersionreturns information about the update prior to the current content update. -
history.contributorsreturns all of the users who have contributed to the content. -
history.nextVersionreturns information about the update after to the current content update. -
ancestorsreturns the parent page, if the content is a page. -
bodyreturns the body of the content in different formats, including the editor format, view format, and export format. -
versionreturns information about the most recent update of the content, including who updated it and when it was updated. -
descendants.pagereturns pages that are descendants at any level below the content. -
descendants.attachmentreturns all attachments for the content, same aschildren.attachment. -
descendants.commentreturns all comments on the content, same aschildren.comment. -
spacereturns the space that the content is in. This is the same as the information returned by Get space.
In addition, the following comment-specific expansions can be used:
-
extensions.inlinePropertiesreturns inline comment-specific properties. -
extensions.resolutionreturns the resolution status of each comment. | |spaceKeyContext| string | | The space key used for resolving embedded content (page includes, files, and links) in the content body. For example, if the source content contains the link<ac:link><ri:page ri:content-title="Example page" /><ac:link>and thespaceKeyContext=TESTparameter is provided, then the link will be converted to a link to the "Example page" page in the "TEST" space. | |contentIdContext| string | | The content ID used to find the space for resolving embedded content (page includes, files, and links) in the content body. For example, if the source content contains the link<ac:link><ri:page ri:content-title="Example page" /><ac:link>and thecontentIdContext=123parameter is provided, then the link will be converted to a link to the "Example page" page in the same space that has the content with ID=123. Note,spaceKeyContextwill be ignored if this parameter is provided. | |embeddedContentRender| string | | Mode used for rendering embedded content, like attachments. -
currentrenders the embedded content using the latest version. -
version-at-saverenders the embedded content using the version at the time of save. |
Request Body
{"value"=>"<string>", "representation"=>"<string>"}
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"value":"eu dolor","representation":"editor2","_expandable":{"content":"anim"},"embeddedContent":[{"entityId":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"entity":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},{"entityId":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"entity":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}}],"webresource":{"keys":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}],"contexts":[{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}],"uris":{"all":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"css":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"js":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"tags":{"all":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"css":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"data":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"js":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},"superbatch":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}}}