REST API - Content/Page
- 1 Replacing the text on the page (replace all)
- 2 Replacing the text on all pages in the space (replace all) EXPERIMENTAL
- 3 Add text to the top of the page (prepend)
- 4 Add text to the end of the page (append)
- 5 Move/reorder page
- 6 Change the creator of all contents in the space created by user
- 7 Change the creator of all content by id’s
Available since v. 2.17.0
New REST APIs:
Available since v. 2.31.0
New REST APIs:
Available since v. 3.12.*
New REST APIs:
Available since v. 3.16.*
Below REST APIs are now available to space administrators:
Replacing the text on the page (replace all)
Available only for Confluence Administrators or Space Administrator
Method type: POST
URL: {CONFLUENCE_URL}/rest/extender/1.0/content/{PAGE_ID}/replaceAll
where {PAGE_ID} is the page
Request format: JSON
Example request:
{
"find": "Jira SD”,
"replace": “Jira SM”,
“ignoreCase”: true
}
{
"find": "Jira SD”,
"replace": “Jira SM”
}
find - required - the text you want to replace
replace - required - the text you want to replace the search text with
ignoreCase - optional - whether the search text should be case-sensitive - true or false (default)
Response format: JSON
Example response:
{
"ignoreCase": true,
"numberOfReplacements": 3,
"message": "done"
}
Replacing the text on all pages in the space (replace all) EXPERIMENTAL
Available only for Confluence Administrators or Space Administrator
Method type: POST
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/{SPACE_KEY}/content/replaceAll
where {SPACE_KEY} is the space key
Request format: JSON
Example request:
find - required - the text you want to replace
replace - required - the text you want to replace the search text with
ignoreCase - optional - whether the search text should be case-sensitive - true or false (default)
Response format: JSON
Example response:
Check process status
Method type - GET
URL: {CONFLUENCE_URL}/rest/extender/1.0/space/content/replaceAll/taskStatus
Example response:
Add text to the top of the page (prepend)
Method type: POST
URL: {CONFLUENCE_URL}/rest/extender/1.0/content/{PAGE_ID}/prepend
where {PAGE_ID} is the page
Request format: JSON
Example request:
Response format: JSON
Example response:
Add text to the end of the page (append)
Method type: POST
URL: {CONFLUENCE_URL}/rest/extender/1.0/content/{PAGE_ID}/append
where {PAGE_ID} is the page
Request format: JSON
Example request:
Response format: JSON
Example response:
Move/reorder page
Method type: POST
URL:
{CONFLUENCE_URL}/rest/extender/1.0/content/movePage
or
{CONFLUENCE_URL}/rest/extender/1.0/content/reorderPage
Request format: JSON
Example request:
Response format: JSON
Example response:
Change the creator of all contents in the space created by user
When sometimes a user leaves your company, you can change the content (pages / blogs) he has created to another user instead of an "unknown user"
Method type: PUT
URL: {CONFLUENCE_URL}/rest/extender/1.0/content/changeCreator/space/{SPACE_KEY}/user/{USER_NAME_OR_KEY}
where {SPACE_KEY} is the space key
where {USER_NAME_OR_KEY} is the user name or the user key
Request format: JSON
Example request:
Response format: JSON
Example response:
Change the creator of all content by id’s
When sometimes a user leaves your company, you can change the content (pages / blogs) he has created to another user instead of an "unknown user"
Method type: PUT
URL: {CONFLUENCE_URL}/rest/extender/1.0/content/changeCreator/contentId
Request format: JSON
Example request:
Response format: JSON
Example response: