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

REST API Needs ability to remove specific versions of an attachment

    • 1
    • 2
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      NOTE: This suggestion is for Confluence Cloud. Using Confluence Server? See the corresponding suggestion.

      If someone has uploaded a file with the same name as an existing file, it becomes the most recent version. If this last upload needs to be removed, the only way to do it and preserve previous versions is to download all versions of the file, remove the attachement (which deletes all revisions), then re-upload all versions carefully typing in the comments.

      It would be very helpful if a specific revision of an attachment could be removed.

          Form Name

            [CONFCLOUD-36015] REST API Needs ability to remove specific versions of an attachment

            Robin Krom added a comment -

            I tried the workaround, which would also be fine by me, as specified here

            Unfortunately I get something like:

            Unable to purge content with id: ContentId{id=32112651}

            If I try to do it with ?status=trashed in the uri, there error is different but similar... I have no idea on how to delete an attachments.

            It's a shame that this ticket has not been resolved after so much time.

            I also noticed that there is in fact only a very slow progress on the Confluence REST API.
            For Greenshot I was writing a reusable REST API client as the Web-Service (SOAP) was deprecated and removed. Still I find a lot of things missing... are there any plans on continueing the development on the REST API?

            Robin Krom added a comment - I tried the workaround, which would also be fine by me, as specified here Unfortunately I get something like: Unable to purge content with id: ContentId{id=32112651} If I try to do it with ?status=trashed in the uri, there error is different but similar... I have no idea on how to delete an attachments. It's a shame that this ticket has not been resolved after so much time. I also noticed that there is in fact only a very slow progress on the Confluence REST API. For Greenshot I was writing a reusable REST API client as the Web-Service (SOAP) was deprecated and removed. Still I find a lot of things missing... are there any plans on continueing the development on the REST API?

            CRK added a comment -

            Here is the procedure to delete an attachment from confluence page, send an "xhr" request with the following parameters:

            URL : http(s)://localhost:8080/confluence/json/removeattachmentversion.action?pageId=<confluence page id>&fileName=<file name>&version=1

            Note: remove the "version=X" in request URL if you wish to delete all the versions of the file.

            Request Type: POST

            Htttp Headers:
            •Content-Type: "application/json"
            •Authorization: "<your authorization code>" ( i.e "Basic base64(username:password)")
            •X-Atlassian-Token: "no-check"

            CRK added a comment - Here is the procedure to delete an attachment from confluence page, send an "xhr" request with the following parameters: URL : http(s)://localhost:8080/confluence/json/removeattachmentversion.action?pageId=<confluence page id>&fileName=<file name>&version=1 Note: remove the "version=X" in request URL if you wish to delete all the versions of the file. Request Type: POST Htttp Headers: •Content-Type: "application/json" •Authorization: "<your authorization code>" ( i.e "Basic base64(username:password)") •X-Atlassian-Token: "no-check"

            chucktalk added a comment -

            Hi Eric,

            Think we have the correct effected versions, and this is not fixed though someone thought it was. Working to get this reviewed.

            chucktalk added a comment - Hi Eric, Think we have the correct effected versions, and this is not fixed though someone thought it was. Working to get this reviewed.

            Eric Brown added a comment - - edited

            I tried to change it, but it looks like I cannot.
            Perhaps I should not have cloned an existing ticket.
            I did so because I was unfamiliar with your conventions.

            Eric Brown added a comment - - edited I tried to change it, but it looks like I cannot. Perhaps I should not have cloned an existing ticket. I did so because I was unfamiliar with your conventions.

            chucktalk added a comment -

            The Release Version here should be 5.5.3, not 5.0-OD-1. Can someone please change that to the correct version?

            chucktalk added a comment - The Release Version here should be 5.5.3, not 5.0-OD-1. Can someone please change that to the correct version?

            chucktalk added a comment -

            Specifically here, what is needed is the ability to DELETE attachments using the REST API. We have a CRUD API that does not perform deletes - so it basically is missing the delete ability here. We have the CR (create) U (update) but not D (delete) , so it is missing the full-CRUD API ability. We should have the ability to delete and by version (or all if desired). The reason here is that this does build up cruft over time, and we should offer a way to remove older versions programmatically for developers.

            chucktalk added a comment - Specifically here, what is needed is the ability to DELETE attachments using the REST API. We have a CRUD API that does not perform deletes - so it basically is missing the delete ability here. We have the CR (create) U (update) but not D (delete) , so it is missing the full-CRUD API ability. We should have the ability to delete and by version (or all if desired). The reason here is that this does build up cruft over time, and we should offer a way to remove older versions programmatically for developers.

            Eric Brown added a comment -

            Currently it seems there is no way to delete an attachment using the REST api.

            Please see service desk ticket:

            https://support.atlassian.com/servicedesk/customer/portal/14/CSP-137230

            Eric Brown added a comment - Currently it seems there is no way to delete an attachment using the REST api. Please see service desk ticket: https://support.atlassian.com/servicedesk/customer/portal/14/CSP-137230

              Unassigned Unassigned
              8a7280258d42 Eric Brown
              Votes:
              38 Vote for this issue
              Watchers:
              28 Start watching this issue

                Created:
                Updated: