Rate this page:
GET /wiki/rest/api/content/{id}/version
Returns the versions for a piece of content in descending order.
Permissions required: Permission to view the content. If the content is a blog post, 'View' permission for the space is required.
Connect app scope required: READ
read:content-details:confluence
string
The ID of the content to be queried for its versions.
integer
The starting index of the returned versions.
0
, Minimum: 0
, Format: int32
integer
The maximum number of versions to return per page. Note, this may be restricted by fixed system limits.
200
, Minimum: 0
, Format: int32
Array<string>
A multi-value parameter indicating which properties of the content to expand. By default, the content
object is expanded.
collaborators
returns the users that collaborated on the version.content
returns the content for the version.form
1 2 3 4 5 6 7 8 9 10 11 12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/content/{id}/version`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the requested versions are returned.
Content type | Value |
---|---|
application/json |
POST /wiki/rest/api/content/{id}/version
Restores a historical version to be the latest version. That is, a new version is created with the content of the historical version.
Permissions required: Permission to update the content.
Connect app scope required: WRITE
read:content-details:confluence
, write:content:confluence
string
The ID of the content for which the history will be restored.
Array<string>
A multi-value parameter indicating which properties of the content to expand. By default, the content
object is expanded.
collaborators
returns the users that collaborated on the version.content
returns the content for the version.form
string
Set to 'restore'.
Valid values: restore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"operationKey": "restore",
"params": {
"versionNumber": 34,
"message": "<string>",
"restoreTitle": true
}
}`;
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/content/{id}/version`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the version is restored.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/version/{versionNumber}
Returns a version for a piece of content.
Permissions required: Permission to view the content. If the content is a blog post, 'View' permission for the space is required.
Connect app scope required: READ
read:content-details:confluence
string
The ID of the content to be queried for its version.
integer
The number of the version to be retrieved.
int32
Array<string>
A multi-value parameter indicating which properties of the content to expand. By default, the content
object is expanded.
collaborators
returns the users that collaborated on the version.content
returns the content for the version.form
1 2 3 4 5 6 7 8 9 10 11 12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/content/{id}/version/{versionNumber}`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the version is returned.
Content type | Value |
---|---|
application/json |
DELETE /wiki/rest/api/content/{id}/version/{versionNumber}
Delete a historical version. This does not delete the changes made to the content in that version, rather the changes for the deleted version are rolled up into the next version. Note, you cannot delete the current version.
Permissions required: Permission to update the content.
Connect app scope required: DELETE
delete:content:confluence
string
The ID of the content that the version will be deleted from.
integer
The number of the version to be deleted. The version number starts from 1 up to current version.
int32
1 2 3 4 5 6 7 8 9 10
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asApp().requestConfluence(route`/wiki/rest/api/content/{id}/version/{versionNumber}`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Returned if the version is deleted.
A schema has not been defined for this response code.
Rate this page: