Deprecated, use Confluence's v2 API.
Returns the labels on a piece of content.
Permissions required: 'View' permission for the space and permission to view the content if it is a page.
read:confluence-content.summary
read:label:confluence
Connect app scope required: READ
string
Requiredstring
integer
integer
Returned if the requested labels are returned.
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.asUser().requestConfluence(route`/wiki/rest/api/content/{id}/label`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"results": [
{
"prefix": "<string>",
"name": "<string>",
"id": "<string>",
"label": "<string>"
}
],
"start": 2154,
"limit": 2154,
"size": 2154,
"_links": {}
}
Adds labels to a piece of content. Does not modify the existing labels.
Notes:
Permissions required: Permission to update the content.
write:confluence-content
read:label:confluence
, write:label:confluence
Connect app scope required: WRITE
string
RequiredThe labels to add to the content.
oneOf [array<LabelCreate>, LabelCreate]
Returned if the labels are added to the content.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `[
{
"prefix": "<string>",
"name": "<string>"
}
]`;
const response = await api.asUser().requestConfluence(route`/wiki/rest/api/content/{id}/label`, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"results": [
{
"prefix": "<string>",
"name": "<string>",
"id": "<string>",
"label": "<string>"
}
],
"start": 2154,
"limit": 2154,
"size": 2154,
"_links": {}
}
Removes a label from a piece of content. Labels can't be deleted from archived content. This is similar to Remove label from content except that the label name is specified via a query parameter.
Use this method if the label name has "/" characters, as Remove label from content using query parameter does not accept "/" characters for the label name.
Permissions required: Permission to update the content.
write:confluence-content
write:label:confluence
Connect app scope required: WRITE
string
Requiredstring
RequiredReturned if the label is removed. The response body will be empty.
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.asUser().requestConfluence(route`/wiki/rest/api/content/{id}/label?name={name}`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Removes a label from a piece of content. Labels can't be deleted from archived content. This is similar to Remove label from content using query parameter except that the label name is specified via a path parameter.
Use this method if the label name does not have "/" characters, as the path parameter does not accept "/" characters for security reasons. Otherwise, use Remove label from content using query parameter.
Permissions required: Permission to update the content.
write:confluence-content
write:label:confluence
Connect app scope required: WRITE
string
Requiredstring
RequiredReturned if the label is removed. The response body will be empty.
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.asUser().requestConfluence(route`/wiki/rest/api/content/{id}/label/{label}`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Rate this page: