Hallo,
i try to download attachments from the confluence sides. With this REST Api Call (https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-api-content-id-child-attachment-get) I can get all attachments on a side. This works as expected.
When I now try to download a attachment with the provided Link (seeing Answer: https://community.atlassian.com/t5/Confluence-questions/How-to-download-a-file-attached-in-confluence-page/qaq-p/650334) I'll get the following error:
status: 403,
text: '{"error":{"code":"Forbidden","title":"Client not found","href":"https://api.media.atlassian.com#UnauthorizedError"}}', method: 'GET'
I also tried to access the link manually and with wget on Powershell there it works as expected and I get the file.
Node.js Superagent Request with Error:
superagent.get(fileURL).end((err: any, res: any) => {
if (err)
console.log(err);
console.log(res);
});
Powershell wget Command without Error:
wget "https://api.media.atlassian.com/file/.../binary?token=...&name=...&max-age=..."
Powershell Result:
StatusCode : 200
StatusDescription : OK
Content : {137, 80, 78, 71...}
RawContent : HTTP/1.1 200 OK
X-B3-Traceid: 2f5a1fff89cb7368
X-B3-Spanid: d7d7fb76b419dbf9
X-B3-Parentspanid: 69d13273d5f83dd5
X-B3-Sampled: 1 X-Dns-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
X-Downlo...
Headers : {[X-B3-Traceid, 2f5a1fff89cb7368], [X-B3-Spanid, 7d7fb76b419dbf9], X-B3-Parentspanid, 69d13273d5f83dd5], [X-B3-Sampled, 1]...}
RawContentLength : 20967
Thanks for your help,
Gregor Ulbricht
I was a bug in Connection with the node Plugin superagent and the proxy server connection.
In almost every case it works, when there is no proxy to set an empty proxy for superagent. When you try to download some files you can't set an empty proxy, either you set an active proxy or you set no proxy otherwise the above subscribed error occurs.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.