Creates a database in the space.
Permissions required: Permission to view the corresponding space. Permission to create a database in the space.
write:database:confluence
Connect app scope required: WRITE
boolean
string
Requiredstring
string
Returned if the database was successfully created.
allOf [DatabaseSingle, object]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `{
"spaceId": "<string>",
"title": "<string>",
"parentId": "<string>"
}`;
const response = await api.asUser().requestConfluence(route`/wiki/api/v2/databases`, {
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
16
17
18
19
20
21
22
{
"id": "<string>",
"type": "<string>",
"status": "current",
"title": "<string>",
"parentId": "<string>",
"parentType": "page",
"position": 59,
"authorId": "<string>",
"ownerId": "<string>",
"createdAt": "<string>",
"version": {
"createdAt": "<string>",
"message": "<string>",
"number": 19,
"minorEdit": true,
"authorId": "<string>"
},
"_links": {
"base": "<string>"
}
}
Returns a specific database.
Permissions required: Permission to view the database and its corresponding space.
read:database:confluence
Connect app scope required: READ
integer
Requiredboolean
boolean
boolean
boolean
Returned if the requested database is returned.
allOf [DatabaseSingle, 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/databases/{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
13
14
15
16
17
18
19
20
21
22
{
"id": "<string>",
"type": "<string>",
"status": "current",
"title": "<string>",
"parentId": "<string>",
"parentType": "page",
"position": 59,
"authorId": "<string>",
"ownerId": "<string>",
"createdAt": "<string>",
"version": {
"createdAt": "<string>",
"message": "<string>",
"number": 19,
"minorEdit": true,
"authorId": "<string>"
},
"_links": {
"base": "<string>"
}
}
Delete a database by id.
Deleting a database moves the database to the trash, where it can be restored later
Permissions required: Permission to view the database and its corresponding space. Permission to delete databases in the space.
delete:database:confluence
Connect app scope required: DELETE
integer
RequiredReturned if the database was successfully deleted.
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/api/v2/databases/{id}`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Rate this page: