Rate this page:
GET /wiki/rest/api/content/{id}/state
Gets the current content state of the draft or current version of content. To specify the draft version, set the parameter status to draft, otherwise archived or current will get the relevant published state.
Permissions required: Permission to view the content.
Connect app scope required: READ
string
The id of the content whose content state is of interest.
string
Set status to one of [current,draft,archived].
Valid values: current
, draft
, archived
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";
const response = await api.requestConfluence(route`/wiki/rest/api/content/{id}/state`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if permission allows viewing of content.
Content type | Value |
---|---|
application/json |
PUT /wiki/rest/api/content/{id}/state
Sets the content state of the content specified and creates a new version (publishes the content without changing the body) of the content with the new state.
Permissions required: Permission to edit the content.
Connect app scope required: WRITE
string
The Id of the content whose content state is to be set.
string
Status of content onto which state will be placed. If draft, then draft state will change. If current, state will be placed onto a new version of the content with same body as previous version.
Valid values: current
, draft
string
name of content state
string
Color of state. Must be in 6 digit hex form (#FFFFFF)
integer
id of state
int64
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";
const response = await api.requestConfluence(route`/wiki/rest/api/content/{id}/state`, {
method: 'PUT',
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if content state is set successfully.
Content type | Value |
---|---|
application/json |
DELETE /wiki/rest/api/content/{id}/state
Removes the content state of the content specified and creates a new version (publishes the content without changing the body) of the content with the new status.
Permissions required: Permission to edit the content.
Connect app scope required: DELETE
string
The Id of the content whose content state is to be set.
string
status of content state from which to delete state. Can be draft or archived
Valid values: current
, draft
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";
const response = await api.requestConfluence(route`/wiki/rest/api/content/{id}/state`, {
method: 'DELETE',
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if content state is removed from content.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/content/{id}/state/available
Gets content states that are available for the content to be set as.
Permissions required: Permission to edit the content.
Connect app scope required: READ
string
id of content to get available states for
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";
const response = await api.requestConfluence(route`/wiki/rest/api/content/{id}/state/available`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the content is found and permission is valid.
Content type | Value |
---|---|
application/json |
GET /wiki/rest/api/space/{spaceKey}/state/settings
Get object describing whether content states are allowed at all, if custom content states or space content states are restricted, and a list of space content states allowed for the space if they are not restricted.
Permissions required: Space admin permission
Connect app scope required: READ
string
The key of the space to be queried for its content state settings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";
const response = await api.requestConfluence(route`/wiki/rest/api/space/{spaceKey}/state/settings`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returned if the requested space exists, and user has space admin permission.
Content type | Value |
---|---|
application/json |
Rate this page: