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

download attachment by rest api

Hi, please help download attachment.

I try using the api:

 

Steps:

1. I get list of attachments by

https:/<my_server>/wiki/rest/api/content/{contentId}/child/attachment

2. get {"_links": {"download"://download/attachments/{attach_id}/test_file.pdf?version=1&modificationDate=1569048258206&cacheVersion=1&api=v2}}

3. call 
https://<mu_server>/download/attachments/{contentId}/test_file.pdf?version=1&modificationDate=1569048258206&cacheVersion=1&api=v2&os_authType=basic
with header Authorization Basic <my_token>

as result I get 404

Please tell me where I mistaken?

Thanks.

 

Best Regards, Dmitry.

 

 

1 answer

1 accepted

0 votes
Answer accepted
DPK J Community Leader Sep 21, 2019

@Dmitriy.Bochkanovare you using /wiki in download url?

i.e.

 

https://<my_server>/wiki/download/attachments/{contentId}/test_file.pdf?version=1&modificationDate=1569048258206&cacheVersion=1&api=v2&os_authType=basic
with header Authorization Basic <my_token>

@DPK J 
Thank a lot. You solve it.
But is it error in "download" link?

 

Best regards, Dmitriy

@Dmitriy.BochkanovActually on Confluence Cloud, the base url contains context path of /wiki so it is not exactly an error, but Atlassian have not mentioned it clearly anywhere.

If this response helped you, you can accept and like the answer so that we can help other.

Like # people like this

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

303 views 1 3
Join discussion

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