If you attempt to POST to this url /rest/api/content/

      {id}/child/attachment where {id}

      is a draft id, the REST service returns an error

      {
          "statusCode":400,
          "data":
          {
              "authorized":false,
              "valid":true,
              "errors":[]
           },
           "message": "The entity Draft = { id: 884782, type: page, title: null, pageId: 0, pageVersion: 0} is not ContentConvertible or API available"}
      }
      

      This makes no sense because a Draft is a ContentEntityObject and it's possible to add an attachment to one through the Java API as well as the Confluence rich text editor.

            [CONFSERVER-38719] Can't attach files to a Draft via REST API

            Steve Lancashire (Inactive) added a comment - Implemented on : https://jira.atlassian.com/browse/CRA-1268

            slancashire, what functionality do we want here? Looking up a draft id using /rest/api/content/draft_id/ results in a 404, but trying to look at attachments on a draft id results in other errors.

            EG '/rest/api/content/draft_id/child/attachment' returns 500 "java.lang.ClassCastException: com.atlassian.confluence.pages.Draft cannot be cast to com.atlassian.confluence.pages.ContentConvertible"

            Louis Lepper (Inactive) added a comment - - edited slancashire , what functionality do we want here? Looking up a draft id using /rest/api/content/draft_id/ results in a 404, but trying to look at attachments on a draft id results in other errors. EG '/rest/api/content/draft_id/child/attachment' returns 500 "java.lang.ClassCastException: com.atlassian.confluence.pages.Draft cannot be cast to com.atlassian.confluence.pages.ContentConvertible"

            kihlberg, It appears that if you add attachments to a draft of an existing page in Confluence, the attachment is simply added to the existing page.

            If you add attachments to a draft not associated with a page, it seems like it's not possible to interact with that draft using our api at all.

            The heart beat that gets sent back to confluence when editing the draft reports for me
            draftId: "720922", pageId: "0". I don't get any results if I try to look up the draft ID using our APIs.

            Louis Lepper (Inactive) added a comment - kihlberg , It appears that if you add attachments to a draft of an existing page in Confluence, the attachment is simply added to the existing page. If you add attachments to a draft not associated with a page, it seems like it's not possible to interact with that draft using our api at all. The heart beat that gets sent back to confluence when editing the draft reports for me draftId: "720922", pageId: "0". I don't get any results if I try to look up the draft ID using our APIs.

              llepper Louis Lepper (Inactive)
              8b87a0f94f00 Ryan Ackley
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: