Using /download/attachments/(*) directly

Hi,

In my add-on, I use /download/attachments/(*) to get attachment content. On https://developer.atlassian.com/static/connect/docs/latest/scopes/confluence-rest-scopes.html, this is listed as one of the REST end points that is available under Connect. However, this end point is not listed in the Confluence REST API documentation at https://docs.atlassian.com/confluence/REST/latest.

My question - is this a safe call to make directly, or should I get the download link from /rest/api/content/{attachment id}? I’m concerned that at some point the call may be changed without warning, as it is not in the REST API docs. I prefer using the call directly because there are a number of macros in my add-ons that pre-date Connect and do not have a reference to the attachment id. If I need to refer to the attachment to get the download url it would require a complex update in which I would have to create a new page version that adds the attachment id into the macro parameters, I would rather not have to do that.

Hi Jan - I’m afraid its not safe to make the call directly as that URL may change. You’ll need to get the download link via /rest/api/content/{attachment id} (as you’ve stated), or use CQL or /rest/api/content/{parentId}/child/attachment

Thank you Caroline. I am placing a JIRA ticket in our next sprint to fix this issue. Are you aware of any intent to change the download url format in the immediate future (more that 2 weeks out), if so I would definitely need to fast track the patch.

Hi Jan - I’m unaware of any immediate plans to change the download URL.