Retrieves the available space roles.
Permissions required: Permission to access the Confluence site; if requesting a certain space's roles, permission to view the space.
read:space.permission:confluence
Connect app scope required: READ
string
string
string
PrincipalType
string
integer
Returned if the requested space roles are retrieved.
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/api/v2/space-roles`, {
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
15
16
17
{
"results": [
{
"id": "<string>",
"type": "SYSTEM",
"displayName": "<string>",
"description": "<string>",
"spacePermissions": [
"<string>"
]
}
],
"_links": {
"next": "<string>",
"base": "<string>"
}
}
Retrieves the space role by ID.
Permissions required: Permission to access the Confluence site.
read:space.permission:confluence
Connect app scope required: READ
integer
RequiredReturned if the requested space role is retrieved.
allOf [SpaceRole, object]
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/api/v2/space-roles/{id}`, {
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
{
"id": "<string>",
"type": "SYSTEM",
"displayName": "<string>",
"description": "<string>",
"spacePermissions": [
"<string>"
],
"_links": {
"base": "<string>"
}
}
Retrieves the space role assignments.
Permissions required: Permission to view the space.
read:space.permission:confluence
Connect app scope required: READ
integer
Requiredstring
string
string
PrincipalType
string
integer
Returned if the requested space role assignments are retrieved.
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/api/v2/spaces/{id}/role-assignments`, {
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
15
{
"results": [
{
"principal": {
"principalType": "USER",
"principalId": "<string>"
},
"roleId": "<string>"
}
],
"_links": {
"next": "<string>",
"base": "<string>"
}
}
Sets space role assignments as specified in the payload.
Permissions required: Permission to manage roles in the space.
write:space.permission:confluence
Connect app scope required: SPACE_ADMIN
integer
RequiredPrincipal
Requiredstring
Returned if the requested update to space role assignments succeeds in its entirety.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"principal": {
"principalType": "USER",
"principalId": "<string>"
},
"roleId": "<string>"
}`;
const response = await api.asUser().requestConfluence(route`/wiki/api/v2/spaces/{id}/role-assignments`, {
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
15
{
"results": [
{
"principal": {
"principalType": "USER",
"principalId": "<string>"
},
"roleId": "<string>"
}
],
"_links": {
"next": "<string>",
"base": "<string>"
}
}
Rate this page: