Attachment URI for Downloading Images

I’m attempting to get an attachment URI in order to download images from my Confluence space into another word-processing editor. I am using the GetAttachments API to get all the attachment information for a given Confluence page, but am struggling to find the URI. I noticed that the API returns a links object that includes a download link for each attachment. That link looks like this:

/download/attachments/1364754433/Screen%20Shot%202022-07-13%20at%208.51.48%20PM.png?version=1&modificationDate=1658429670669&cacheVersion=1&api=v2

This looks promising, so I am wondering what I need to append to this download link in order to form the attachment URI so that I can download the image.

Hi @AndrsBeckRuiz ,

You should be able to prepend your Confluence Cloud tenant URL to the path identified by the download parameter(s) from the GET /wiki/rest/api/content/{id}/child/attachment results.

For example, if the base URL of your tenant is https://example.atlassian.net/wiki, the absolute URL to attachments will look like https://example.atlassian.net/wiki/download/attachments/....

Note the /wiki at the start of the path.

I’ve created CONFCLOUD-74412 to request the documentation be improved.

Regards,
Dugald

1 Like