My company is using Confluence Cloud.
I'm fetching a page from Confluence cloud (successfully, with a Perl app, but I'm talking any client), and the page has an attachment. When I GET the attachment, I get a 302 redirect, with a location.
Ok, but the location is at api.media.atlassian.com, and I'm using basic auth to get my pages. When I try to get my resource (an image) at the new location, I get this:
HTTP/1.1 401 Unauthorized
. . .a bunch of other stuff. . .
{"error":{"code":"ForbiddenError","title":"This resource requires authorization","href":"https://api.media.atlassian.com#AuthenticationGuide"}}
(Typing https://api.media.atlassian.com#AuthenticationGuide into a browser gives me a http 403.)
So how do I authenticate my client to api.media.atlassian? basic auth doesn't do it, my user id in a cookie doesn't do it; In the Web interface to Confluence Cloud, my browser receives a cookie called 'ajs_anonymous_id', but passing that cookie to api.media.atlassian doesn't work.
Suggestions welcome. . .