It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating space using REST API creates it with "old" editor ? Edited

Hello,

Recently I've noticed that if you create for example Blank or Personal space in Confluence Cloud manually, i.e through Create space dialog it will create new space with "modern/new" editor (probably it's called editor-v2).

However I am wondering, when creating new space using REST API it will still create space with "old" editor - is that by default or there's some parameter which needs to be specified in API request in order to get new editor when creating space using REST API ?

 

curl --user user@name.net:someAPIToken --request POST --url 'https://myConfluenceInstance.atlassian.net/wiki/rest/api/space' --header 'Accept: application/json' --header 'Content-Type: application/json' --data { 
     "key":"My New Space",
     "name":"test 123",
     "description":{
        "plain":{
            "value":"some value",
            "representation":"some representation"
       }
    }
}


Here's an example where you can see the difference between "old" and "new" editor:

Old editor

editor_old.png

 

New editoreditor_new.png
 

6 answers

3 accepted

2 votes
Answer accepted

you need to define metadata

something like this 

 

"body": {
"storage": {
"value": "<h1>Test page</h1>",
"representation": "storage"
},
"metadata": {
"properties": {
"editor" : {
"value" : "V2"
}
}
}

you can search in the forum and you will get more details.
Like Shannon Spaniol likes this
0 votes
Answer accepted

Hello there,

Welcome to Atlassian Community! It's nice to have you.

Right now I believe this depends on the Cloud site itself, so it's something we'll need to take a look at in support for your instance. Can you see if you're able to create a support ticket, and if not, let me know and I can take care of that for you?

Regards,

Shannon

Hello, Shannon !

I've created support ticket and hopefully it will get resolved.

Thank you for your help.

Best regards,
A.L

Like Shannon Spaniol likes this

You're welcome! Let us know what you find out!

Regards,

Shannon

Hi @Shannon Spaniol could you solve this issue? I'm dealing with a similar problem. Any pages created via REST API show up with the old editor experience. Is there any parameter to set in the request?

Here is an example REST request. 

POST {{host}}/rest/api/content
Accept: application/json
Content-Type: application/json
Authorization: Basic {{basic-auth-token}}

{
"title": "Test page 1",
"type": "page",
"space": {
"key": "MCT"
},
"status": "current",
"ancestors": [
{
"id": "54755348"
}
],
"body": {
"storage": {
"value": "<h1>Test page</h1>",
"representation": "storage"
}
}
}

I tried to set both "storage" to "editor2" but that did not change anything. When the user edits the page, the old editor is showing up. How can the new editor be used for pages created via REST API? 

Hi Lukas, @Waldemar Reusch@Pete Dunham,

Xe was able to log a case with support, where we had a look at their site and determined that this was caused by the following bug:

  •   CONFCLOUD-68057 Creating a page via API doesn't load the New Editing Experience

Currently, there is no workaround for this. Please make sure to click This affects my team so you can be updated in the future if that changes.

Take care,

Shannon

0 votes
Answer accepted

Here's a complete and cleaned-up example for creating a new-style page:

curl -u 'user:apitoken' -H 'content-type: application/json' \
'https://hello.atlassian.net/wiki/rest/api/content' \
-d '{
"type": "page",
"title": "Page created via API",
"space": {
"key": "TEST"
},
"body": {
"storage": {
"value": "<h1>Test page</h1>",
"representation": "storage"
}
},
"metadata": {
"properties": {
"editor": {
"value": "v2"
}
}
}
}'

@Xe Co  did you find a solution path?

I am dealing with the same issue.

I'm also interested in a solution.

I'm also facing the same issue.

Hello @naveenkumar_dp ,

Thank you for following-up here! I'm not sure if you saw, but this has been logged as the following bug:

  • CONFCLOUD-68057 Creating a page via API doesn't load the New Editing Experience

There's a workaround explained on that case.

If you have any trouble with it, can you let us know?

Thank you,

Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

2,117 views 4 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you