Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-68057

Creating a page via API doesn't load the New Editing Experience

      Issue Summary

      When our instance is rolled out to the new editing experience if we create a new page or space using API, this page and space is created in the old editor and are not converted to the new editing experience when edited.

      Environment

      • Cloud
      • New Editing Experience

      Steps to Reproduce

      1. Create a page via API - you can use the below curl:
        curl -i -X POST \
            -u '<email_address>:<API_TOKEN>' \
            -H 'Accept: application/json' \
            -H 'Content-Type: application/json' \
            -d '{
                  "title": "<PAGE_TITLE>",
                  "type": "page",
                  "space": {
                    "key": "<SPACEKEY>"
                  },
                  "status": "current",
                  "body": {
                    "storage": {
                      "value": "<p>Better days will come :D</p>",
                      "representation": "storage"
                    }
                  }
                }' \
            https://<SITE_NAME>.atlassian.net/wiki/rest/api/content 

        To create your API token, jump here

      1. Go to the page you just created;
      2. It is with the old editor, try to edit it.
        And
      3. Create a space via API - you can use the below curl:
        curl --user someUser@myDomain.com:apiTokenHere -
        -request POST --url 'https://<SITE_NAME>.atlassian.net/wiki/rest/api/space' 
        --header 'Accept: application/json' 
        --header 'Content-Type: application/json' 
         --data '{"key":"ACS","name": "API Created Space","description": {"plain": {"value": "someValue","representation": "someRepresentation"}}}'
        

        Expected Results

      When accessing the page/space overview page, the published version should be already in the new editor, but even editing it, the page should be converted to the new editing experience.

      Actual Results

      The pages is with the old editor and doesn't get converted.

      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",
      });

          Form Name

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

            MS added a comment -

            I am also having this issue when creating pages with Python. And I found that some pages restored by the Rewind Backup product also had this issue. On first examination, it appears that these were simple pages without any new editor macros.

            MS added a comment - I am also having this issue when creating pages with Python. And I found that some pages restored by the Rewind Backup product also had this issue. On first examination, it appears that these were simple pages without any new editor macros.

            Jon Booth added a comment -

            Hey I don't know if anyone is still watching this old issue - however, I've got exactly the same problem when using the new v2 api with rest. https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-post

            Since this ticket comes up and is referenced to when you search around for this problem, I'm wonderin if it can be reopened or a new work around described here please? 

            Jon Booth added a comment - Hey I don't know if anyone is still watching this old issue - however, I've got exactly the same problem when using the new v2 api with rest. https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-post Since this ticket comes up and is referenced to when you search around for this problem, I'm wonderin if it can be reopened or a new work around described here please? 

            Hi Giuliano,

            I tried the official REST API, and ended up with the same error.

            Could you kindly take a look at this?
            https://community.developer.atlassian.com/t/a-page-created-via-api-is-not-displayed-with-error-this-editor-does-not-support-displaying-this-content/52403/4
            If i have a clue, such as html tags or a specific structure not to be used in page body, that will helpful.

            Also, thanks a lot for other info on atlassian-python-api, though it'll take time for me to do these.

            Masaya YAMAMOTO added a comment - Hi Giuliano, I tried the official REST API, and ended up with the same error. Could you kindly take a look at this? https://community.developer.atlassian.com/t/a-page-created-via-api-is-not-displayed-with-error-this-editor-does-not-support-displaying-this-content/52403/4 If i have a clue, such as html tags or a specific structure not to be used in page body, that will helpful. Also, thanks a lot for other info on atlassian-python-api, though it'll take time for me to do these.

            Dear gdecampos, thanks for the quick feedback. I assume you have no ETA when this be fixed, right? I hope at least, it will not take 2 years like here^^

            Lars Stuber added a comment - Dear  gdecampos , thanks for the quick feedback. I assume you have no ETA when this be fixed, right? I hope at least, it will not take 2 years like here^^

            Hello 48029e779fef,

            We appreciate all your efforts to raise a new request in our developer community and also bringing it here, which indicates that this could be definitely related.

            While the changes/fixes to our API could have caused the current symptoms that you are noticing, the script used comes from a third-party library (https://atlassian-python-api.readthedocs.io/) that is not officially supported nor developed by Atlassian, my friend. In this case, if you attempt to create a new page using the official REST call (not from the script), will that allow you to view it properly, using the new/current editor due to this fix?

            If so, a good catch could be to go to the Github page for the library > Issues, then, select the New issue option: https://github.com/atlassian-api/atlassian-python-api/issues

            If it helps, I could also see that there was a release for the Confluence code in the script, 12 days ago, putting parameters tied to the editors used: https://github.com/atlassian-api/atlassian-python-api/commit/519813a5f910af4984c32af3949637424133c289

            I hope it helps, Masaya! However, feel free to let us know if there is any observation to be looked from the Atlassian side. We will be more than happy to help!

            Wish you the best,
            Giuliano C.
            Atlassian Team

            Giuliano C. added a comment - Hello 48029e779fef , We appreciate all your efforts to raise a new request in our developer community and also bringing it here, which indicates that this could be definitely related. While the changes/fixes to our API could have caused the current symptoms that you are noticing, the script used comes from a third-party library ( https://atlassian-python-api.readthedocs.io/ ) that is not officially supported nor developed by Atlassian, my friend. In this case, if you attempt to create a new page using the official REST call (not from the script), will that allow you to view it properly, using the new/current editor due to this fix? If so, a good catch could be to go to the Github page for the library > Issues , then, select the New issue option: https://github.com/atlassian-api/atlassian-python-api/issues If it helps, I could also see that there was a release for the Confluence code in the script, 12 days ago, putting parameters tied to the editors used: https://github.com/atlassian-api/atlassian-python-api/commit/519813a5f910af4984c32af3949637424133c289 I hope it helps, Masaya! However, feel free to let us know if there is any observation to be looked from the Atlassian side. We will be more than happy to help! Wish you the best, Giuliano C. Atlassian Team

            Hi lars.stuber,

            I want to thank you for testing it and bringing this opportunity, friend!

            Unfortunately the implementation does not fix the creation of new spaces via API. The overview page is still created with Legacy Editor.

            Can you please verify that this shouldn't be fixed with your mentioned fix?

            I do confirm that the current fix does not fix the creation of new spaces via API and we just discovered it thanks to your comment. After testing it, I was able to reproduce this issue and created the new bug below so we can fix it at a code level:

            Feel free to add yourself as a watcher and even share your thoughts there. The closest workaround that I've found was to edit the home page once it gets created, which will automatically open it in the new editor.

            Thank you again, Lars!

            Wish you the best,
            Giuliano C.
            Atlassian Team

            Giuliano C. added a comment - Hi lars.stuber , I want to thank you for testing it and bringing this opportunity, friend! Unfortunately the implementation does not fix the creation of new spaces via API. The overview page is still created with Legacy Editor. Can you please verify that this shouldn't be fixed with your mentioned fix? I do confirm that the current fix does not fix the creation of new spaces via API and we just discovered it thanks to your comment. After testing it, I was able to reproduce this issue and created the new bug below so we can fix it at a code level: Creating spaces via API doesn't load the new/current editor for the home page Feel free to add yourself as a watcher and even share your thoughts there. The closest workaround that I've found was to edit the home page once it gets created, which will automatically open it in the new editor. Thank you again, Lars! Wish you the best, Giuliano C. Atlassian Team

            Masaya YAMAMOTO added a comment - - edited

            Hello @Guiliano ,

            I have a ploblem which this topic might be related or similar.

            A page created on Confluence cloud via api using Atlassian Python API wrapper *1 is not displayed with error “This editor does not support displaying this content”.

            error screeen capture

            *1 Confluence module — Atlassian Python API 3.14.0 documentation

             

            Could you please take a look at this and give me a hint?

            A page created via API is not displayed with error "This editor does not support displaying this content" - Confluence Development - The Atlassian Developer Community

            Thank you in advance,

            Masaya

            Masaya YAMAMOTO added a comment - - edited Hello @Guiliano , I have a ploblem which this topic might be related or similar. A page created on Confluence cloud via api using Atlassian Python API wrapper *1 is not displayed with error “This editor does not support displaying this content”. error screeen capture *1  Confluence module — Atlassian Python API 3.14.0 documentation   Could you please take a look at this and give me a hint? A page created via API is not displayed with error "This editor does not support displaying this content" - Confluence Development - The Atlassian Developer Community Thank you in advance, Masaya

            Hi @Giuliano,

            thanks for the update. Unfortunately the implementation does not fix the creation of new spaces via API. The overview page is still created with Legacy Editor.

            Can you please verify that this shouldn't be fixed with your mentioned fix?

            Thanks in advance!

            Lars

            Lars Stuber added a comment - Hi @Giuliano, thanks for the update. Unfortunately the implementation does not fix the creation of new spaces via API. The overview page is still created with Legacy Editor . Can you please verify that this shouldn't be fixed with your mentioned fix? Thanks in advance! Lars

            No problems, sasha2! It's Atlassian that has to thank you for the opportunity for improvement.

            As for your inquiries:

            But could you tell us if it is still possible to create pages via API to open (for edit) in legacy editor? I can do that only if I create a page that cannot be converted (for example if it contains bodied bested macros), but is there a flag/parameter to give with API call to ensure it always opens in legacy editor?

            The workaround used by you would be the current recommendation so the conversion to the current/new editor would not happen. We actually appreciate you sharing it so it can help customers in the same situation, needing the legacy editor pages to be created via API.

            Wish you the best,
            Giuliano C.
            Atlassian Team

            Giuliano C. added a comment - No problems, sasha2 ! It's Atlassian that has to thank you for the opportunity for improvement. As for your inquiries: But could you tell us if it is still possible to create pages via API to open (for edit) in legacy editor? I can do that only if I create a page that cannot be converted (for example if it contains bodied bested macros), but is there a flag/parameter to give with API call to ensure it always opens in legacy editor? The workaround used by you would be the current recommendation so the conversion to the current/new editor would not happen. We actually appreciate you sharing it so it can help customers in the same situation, needing the legacy editor pages to be created via API. Wish you the best, Giuliano C. Atlassian Team

            Hi

            Thanks @Giuliano

            But could you tell us if it is still possible to create pages via API to open (for edit) in legacy editor?

            I can do that only if I create a page that cannot be converted (for example if it contains bodied bested macros), but is there a flag/parameter to give with API call to ensure it always opens in legacy editor?

            Alex

            Alex Medved {ConfiForms} added a comment - Hi Thanks @Giuliano But could you tell us if it is still possible to create pages via API to open (for edit) in legacy editor? I can do that only if I create a page that cannot be converted (for example if it contains bodied bested macros), but is there a flag/parameter to give with API call to ensure it always opens in legacy editor? Alex

              kkaushik@atlassian.com Kuldeep
              vsiqueira Vinicius (Inactive)
              Affected customers:
              22 This affects my team
              Watchers:
              32 Start watching this issue

                Created:
                Updated:
                Resolved: