Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous task.
Supported conversions:
No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5 minutes at the result endpoint.
Permissions required: If request specifies 'contentIdContext', 'View' permission for the space, and permission to view the content.
read:confluence-content.allread:content.metadata:confluenceConnect app scope required: READ
string
Requiredarray<string>
string
string
boolean
string
The content body to convert.
string
Requiredstring
Requiredany
Returned if the content is added to the messaging queue for conversion. This id will be available for 5 minutes after the conversion is complete.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import { requestConfluence } from "@forge/bridge";
var bodyData = `{
"value": "<string>",
"representation": "view"
}`;
const response = await requestConfluence(`/wiki/rest/api/contentbody/convert/async/{to}`, {
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
{
"asyncId": "<string>"
}Returns the content body for the corresponding asyncId of a completed conversion task. If
the task is not completed, the task status is returned instead.
Once a conversion task is completed, the result can be obtained for up to 5 minutes, or
until an identical conversion request is made again with the allowCache parameter set to
false.
Permissions required: If request specifies 'contentIdContext', 'View' permission for the space, and permission to view the content.
read:confluence-content.allread:content.metadata:confluenceConnect apps cannot access this REST resource.
string
RequiredReturned if successfully found an async conversion task associated with the id.
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import { requestConfluence } from "@forge/bridge";
const response = await requestConfluence(`/wiki/rest/api/contentbody/convert/async/{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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
"value": "<string>",
"representation": "view",
"renderTaskId": "<string>",
"error": "<string>",
"status": "WORKING",
"embeddedContent": [
{
"entityId": 2154,
"entityType": "<string>",
"entity": {}
}
],
"webresource": {
"_expandable": {
"uris": "<string>"
},
"keys": [
"<string>"
],
"contexts": [
"<string>"
],
"uris": {
"all": [
"<string>"
],
"css": [
"<string>"
],
"js": [
"<string>"
],
"_expandable": {
"css": [
"<string>"
],
"js": [
"<string>"
]
}
},
"tags": {
"all": "<string>",
"css": "<string>",
"data": "<string>",
"js": "<string>",
"_expandable": {}
},
"superbatch": {
"uris": {
"all": [
"<string>"
],
"css": [
"<string>"
],
"js": [
"<string>"
]
},
"tags": {
"all": "<string>",
"css": "<string>",
"data": "<string>",
"js": "<string>"
},
"metatags": "<string>",
"_expandable": {}
}
},
"mediaToken": {
"collectionIds": [
"<string>"
],
"contentId": "<string>",
"expiryDateTime": "<string>",
"fileIds": [
"<string>"
],
"token": "<string>"
},
"_expandable": {
"content": "<string>",
"embeddedContent": "<string>",
"webresource": "<string>",
"mediaToken": "<string>"
},
"_links": {}
}Returns the content body for the corresponding asyncId of a completed conversion task. If
the task is not completed, the task status is returned instead.
Once a conversion task is completed, the result can be obtained for up to 5 minutes, or
until an identical conversion request is made again with the allowCache parameter set to
false.
Note that there is a maximum limit of 50 task results per request to this endpoint.
Permissions required: Permission to access the Confluence site ('Can use' global permission).
read:confluence-content.allread:content.metadata:confluenceConnect apps cannot access this REST resource.
array<string>
RequiredReturned if asynchronous conversion tasks are successfully found.
array<AsyncContentBody>
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import { requestConfluence } from "@forge/bridge";
const response = await requestConfluence(`/wiki/rest/api/contentbody/convert/async/bulk/tasks?ids={ids}`, {
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
[
{
"value": "<string>",
"representation": "view",
"renderTaskId": "<string>",
"error": "<string>",
"status": "WORKING",
"embeddedContent": [
{
"entityId": 2154,
"entityType": "<string>",
"entity": {}
}
],
"webresource": {
"_expandable": {
"uris": "<string>"
},
"keys": [
"<string>"
],
"contexts": [
"<string>"
],
"uris": {
"all": [
"<string>"
],
"css": [
"<string>"
],
"js": [
"<string>"
],
"_expandable": {
"css": [
"<string>"
],
"js": [
"<string>"
]
}
},
"tags": {
"all": "<string>",
"css": "<string>",
"data": "<string>",
"js": "<string>",
"_expandable": {}
},
"superbatch": {}
},
"mediaToken": {
"collectionIds": [
"<string>"
],
"contentId": "<string>",
"expiryDateTime": "<string>",
"fileIds": [
"<string>"
],
"token": "<string>"
},
"_expandable": {
"content": "<string>",
"embeddedContent": "<string>",
"webresource": "<string>",
"mediaToken": "<string>"
},
"_links": {}
}
]Asynchronously converts content bodies from one format to another format in bulk. Use the Content body REST API to get the status of conversion tasks. Note that there is a maximum limit of 10 conversions per request to this endpoint.
Supported conversions:
Once a conversion task is completed, it is available for polling for up to 5 minutes.
Permissions required:
'View' permission for the space, and permission to view the content if the spaceKeyContext or
contentIdContext are present.
read:confluence-content.allread:content.metadata:confluenceConnect app scope required: READ
An array of parameters to create content body conversion tasks.
array<ContentBodyConversionInput>
Returned if asynchronous tasks are created to convert content bodies. If a conversion task fails to be created, a “FAILED_TO_QUEUE” string will be returned instead of an asyncId.
array<AsyncId>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import { requestConfluence } from "@forge/bridge";
var bodyData = `{
"conversionInputs": [
{
"to": "<string>",
"allowCache": true,
"spaceKeyContext": "<string>",
"contentIdContext": "<string>",
"embeddedContentRender": "current",
"expand": [
"<string>"
],
"body": {
"value": "<string>",
"representation": "view"
}
}
]
}`;
const response = await requestConfluence(`/wiki/rest/api/contentbody/convert/async/bulk/tasks`, {
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
[
{
"asyncId": "<string>"
}
]Rate this page: