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

Xe Co January 20, 2020

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
Leonid Sokolovskiy March 25, 2020

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.
Abhishek Parmar May 8, 2020

The value should be v2

Like Shannon S likes this
1 vote
Answer accepted
Robin Stocker
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 10, 2020

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"
}
}
}
}'
Matt Casey March 19, 2021

Thank you! This would be great to have in the REST documentation.

Sinu John April 30, 2023

What is the equivalent of this for the new v2 api `wiki/api/v2/pages`? I'm not able to get this to work with the new API. Please point me to the documentation.

Like # people like this
Suyash Rane June 14, 2023

@Robin Stocker Thanks but since we are not supposed to use the old API now. Is there a way to do this in new API?

Like # people like this
0 votes
Answer accepted
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2020

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

Xe Co January 23, 2020

Hello, Shannon !

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

Thank you for your help.

Best regards,
A.L

Like Shannon S likes this
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 23, 2020

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

Regards,

Shannon

Lukas Gotter _ Meetical
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 26, 2020

Hi @[deleted] 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? 

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 26, 2020

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
naveenkumar_dp June 29, 2020

I'm also facing the same issue.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 1, 2020

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

Lars Stuber March 23, 2021

@Shannon S all those answers are not answering the question of the ticket creator. How do I select the new editor v2 when creating a completely new SPACE. When I tried to add meta data, still the "Overview" page of the created space is in v1 editor. Do you have also a workaround for this?

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2021

Hi Lars, 

Thank you for pointing that out. The same applies in both situations, whether you're creating a single page or a space, thus creating multiple new pages at once. When there's a difference in the editor used, it's specific to the Cloud site and will require a support ticket to determine.

I know of a bug where when someone creates a Jira space, the overview page is on the legacy editor. There may be similar cases for other types of spaces, but I'm not yet aware of those. I'll share my example below.

  • CONFCLOUD-69729 Creating new space associated with the project through JSD has Overview page in the old editor

If you encounter a similar issue but not with a JSD space, can you send that to support using the support contact form? If you have a free account or are on an account type that doesn't allow for that, create a new question here on Community, tag me on it, and I'll help report that to the Cloud team.

Thank you, and take care!

Shannon

Like Lars Stuber likes this
0 votes
Waldemar Reusch February 26, 2020

I'm also interested in a solution.

0 votes
Pete Dunham February 7, 2020

@Xe Co  did you find a solution path?

I am dealing with the same issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events