Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Fetch an image from api.media.atlassian.com - Authentication

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. . .

2 answers

1 accepted

0 votes
Answer accepted

Yes, sorry, but perhaps someone else can benefit from my mistake. . .

 

I was using cURL to try to fetch the image.  When I put the uri from the 'location' into quotes, it worked.

 

The authentication is in the 'token' part of the uri.  The token expires after some time, not sure how long.

what does this mean in plain simple English imagine you are explaining it to a 7 year old

 

i got the same error just trying to understand what it could mean

 

thanks in advance  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

43,960 views 33 137
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you