There are so many questions so far around the topic “How to download attachments content using OAuth2”. What is surprising, no one gave a definite answer about it, either not answering or giving the obscure one.
So I would like to ask Atlassian’s developers once again. Is there any possibility to download attachments content using OAuth2?
So far it was possible using download link e.g “https://{instance_url}/wiki/download/attachments/{id}/{name}”. Right now it is not possible any more. It only works using Basic Auth.
Error which occurs when trying to download file using download link and OAuth2 access token:
Status Code: 503 Service Temporarily Unavailable
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Encountered a 401 - Unauthorized error while loading this page.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Atlassian Cloud Notifications - Page access unauthorized</title>
<link rel="stylesheet" href="/_edge/resources/aui-prototyping.css">
<style>
body {
background: #fff;
}
main {
margin: auto;
padding-top: 120px;
text-align: center;
}
.suggestion {
font-size: 16px;
color: rgb(94, 108, 132);
width: 350px;
padding-top: 20px;
margin: auto;
}
</style>
</head>
<body>
<main>
<img
src="/_edge/resources/images/error-generic.svg"
alt="error icon"
width="120"
/>
<h2>
There was a problem accessing this content
</h2>
<p class="suggestion">
Encountered a 401 - Unauthorized error while loading this page.
</p>
</main>
</body>
</html>
So the answer is- as of now, we do not support 3LO for downloading images. We are aware of this and are looking into it but have no ETA for the support.
Do you know the answer why downloading attachment using OAuth2 and download link like “https://{instance_url}/wiki/download/attachments/{id}/{name}” was working and all of a sudden it stopped working? Now there is 503/401 error described in the question.