Attachments fails to download using the download link that we get from "Get attachments for page" API, 401 error occurs

XMLWordPrintable

    • 5
    • Minor
    • 2
    • Warranty

      Issue Summary

      Users are unable to download the attachments using the download link obtained from the "Get Attachments for Page" API; a 401 error occurs. While loading the download link in a browser works without any issues, attempts to use the download link with curl or wget, along with basic authentication using an email and API token, result in a 401 error.

      Steps to Reproduce

      1. Utilize the API to retrieve the attachments linked to the page. The API output will be in JSON format and will include download links for the attachments.
      2. Create a CURL command to download attachments using the provided download link with basic authentication; it will result in a 401 error.

      Expected Results

      The attachment should be downloadable using API, curl or wget.

      Actual Results

      401 error occurs

      Workaround

      Use the V1 API's Get URI to download attachment endpoint:

      curl -L --request GET --url "YOUR_SITE/wiki/rest/api/content/PAGE_CONTENT_ID/child/attachment/ATTACHMENT_ID_WITH_ATT_PREFIX/download" --header 'authorization: Basic AUTH_TOKEN_GOES_HERE' --output download.png

              Assignee:
              Benjamin Wang
              Reporter:
              Rishabh
              Votes:
              4 Vote for this issue
              Watchers:
              15 Start watching this issue

                Created:
                Updated:
                Resolved: