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

Trying to create a page for new editor using the REST API isn't consistent

    XMLWordPrintable

Details

    Description

      Environment

      • Confluence Cloud, Rest API

      Steps to Reproduce

      Try to create a page in the new editor using a body like:

      curl -X POST \
        'https://instance.atlassian.net/wiki/rest/api/content?expand=body.atlas_doc_format' \
        -H 'Accept: application/json' \
        -H 'Authorization: Basic <my token>' \
        -H 'Content-Type: application/json' \
        -d '{
        "title": "Test Page",
        "type": "page",
        "space": {
          "key": "EC"
        },
        "status": "draft",
        "body": {
          "atlas_doc_format": {"value":"{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Some text in a paragraph\"}]}]}"}
        }
      }' 

      and it returns a 200 and creates a page, but the body is left empty.

      Expected Results

      The body is what is passed in the API.

      Actual Results

      The body for the created page is empty.

      Workaround

      Instead of:

       "body": { "atlas_doc_format": {"value":"{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Some text in a paragraph\"}]}]}"} }
      

      use:

       "body": {
          "editor": {
            "value":"{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Some text in a paragraph\"}]}]}",
            "representation":"atlas_doc_format"
          }
        }
      

      which works.

      Attachments

        Issue Links

          Activity

            People

              kihlberg Klaus (Inactive)
              kihlberg Klaus (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: