Hi there,
I already managed to get a page in storage format via REST API from Confluence.
Is there also a way to do this for a template.
I want to get the template in storage format to do some modifications (add some data) and then create a page from that template and store that page also via REST API back to confluence.
Thanks
Bastian
You won't find any documentation on this as no public API exists. However there is some experimental API which can be used on your own risk (may break in future versions of Confluence).
I was testing these commands with Confluence 6.14-m77 but the API is there since 5.10. To explore the experimental API's you should install Atlassian's REST API Browser app in Confluence.
This is an example on 'how to get the storage format for a template'. All other steps required for your use case could use public API again.
GET http://localhost:8090/rest/experimental/template/page?spaceKey=BC&expand=body
BS was the spaceKey of the space my template is stored. In the call the body element was expanded as this contains the storage format - see response below.
{
"results": [
{
"templateId": "2752514",
"name": "FOOO",
"description": "",
"space": {
"id": 2555905,
"key": "BC",
"name": "BLANK CONFLUENCE",
"type": "global",
"_links": {
"webui": "/display/BC",
"self": "http://localhost:8090/rest/api/space/BC"
},
"_expandable": {
"metadata": "",
"icon": "",
"description": "",
"homepage": "/rest/api/content/2523138"
}
},
"labels": [],
"templateType": "page",
"body": {
"storage": {
"value": "<at:declarations /><p>FOOOO</p>",
"representation": "storage"
}
},
"_links": {
"self": "http://localhost:8090/rest/experimental/template/2752514"
}
}
],
"start": 0,
"limit": 25,
"size": 1,
"_links": {
"self": "http://localhost:8090/rest/experimental/template/page?spaceKey=BC&expand=body",
"base": "http://localhost:8090",
"context": ""
}
}
Have fun coding :)
Best, Tobias
Hi Tobias,
thank you very much, that's great.
Best,
Bastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"I already managed to get a page in storage format via REST API from Confluence."
How do you get a page in storage format via the Confluence API?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.