I have been using the REST API in Python to create pages programmatically, but I have found that the pages created by the API show "This page can converted to the new editor" at the bottom indicating that they were created with the old editor.
Is there a way to use the API to create pages with the new interface?
I have tried entering my User-Agent, but it does not appear to make a difference.
Hello @Ellen Su and @Joshua Sneed Contegix ,
This is a known issue tracked as:
In the workaround section (as well as in the comments) it is explained how to create a page using the new editor via REST API:
Workaround
It's possible to simply add the following metadata to the request's payload, so the page will be created using the new editor:
"metadata": { "properties": { "editor": { "key": "editor", "value": "v2" } } }Here's a complete example;
fetch("https://INSTANCE.atlassian.net/wiki/rest/api/content", { "credentials": "include", "headers": { "content-type": "application/json", }, "body": `{ "title": "Test new page (API)", "type":"page", "status":"current", "space":{ "key":"TS" }, "body": { "storage": { "value": "<p>Created through the REST API</p>", "representation": "storage" } }, "metadata": { "properties": { "editor": { "key": "editor", "value": "v2" } } } }`, "method": "POST", });
Please vote for the above bug ticket and set yourself as a watcher so that you will be notified in case of any update/progress. The bug will be addressed according to the Atlassian Cloud bug fixing policy.
Cheers,
Dario
Hi Ellen,
Like all of Atlassian's Cloud products, Confluence's API may be updated without notification. The endpoint likely changed. Check out Atlassian's Confluence Cloud API Reference and Developer API Reference. Cheers!
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.