How can I download confluence attachment with Oauth 2.0 3LO
Asked by Anuja Deshpande:

I tried to download the attachment using but its giving 401  

[https://api.atlassian.com/ex/confluence/{cloudId}/rest/api/download/attachments/684556356/Screen%20Shot%202019-10-11%20at%203.19.28%20PM.png?version=1\&modificationDate=157787674135\&cacheVersion=1\&api=v2](https://api.atlassian.com/ex/confluence/{cloudId}/rest/api/download/attachments/684556356/Screen%20Shot%202019-10-11%20at%203.19.28%20PM.png?version=1&modificationDate=157787674135&cacheVersion=1&api=v2)  

<br />


Answers:
author: Emre Teomete
body: Is there any solution to solve this issue?


author: David at David Simpson Apps
body: Please explain how you attempted to download this attachment.

* In a browser, in the same session as your Confluence Cloud instance?
* Programmatically with curl or something similar?

What are the steps to reproduce your situation?

comments: author: Anuja Deshpande
body: [@David at David Simpson Apps](/t5/user/viewprofilepage/user-id/781462)   
I want to do it programmatically , I tried to hit this API/request from the postman with Oauth 2.0 3LO access token.  

Step 1:

I hit this API : <https://api.atlassian.com/ex/confluence/{cloudId}/rest/api/content/{pageId}?expand=children.comment,children.attachment>  

received \`downloadUrl\` : \`[download/attachments/684556356/Screen%20Shot%202019-10-11%20at%203.19.28%20PM.png?version=1\&modificationDate=157787674135\&cacheVersion=1\&api=v2](https://api.atlassian.com/ex/confluence/%7BcloudId%7D/rest/api/download/attachments/684556356/Screen%20Shot%202019-10-11%20at%203.19.28%20PM.png?version=1&modificationDate=157787674135&cacheVersion=1&api=v2)\`  

and tried hitting this received url with postman using Oauth 2.0 access token


author: Anuja Deshpande
body: I just want to know the API for downloading attachments using API and Oauth2.0 3LO access token.


author: Anuja Deshpande
body: [@David at David Simpson Apps](/t5/user/viewprofilepage/user-id/781462)   

I tried doing it using API (using Postman)  
to reproduce follow these steps  
1. Get attachments for given page id  
API that I used: \`<https://api.atlassian.com/ex/confluence/{cloudId}/rest/api/content/{pageId}?expand=children.comment,children.attachment>\`  

2. received download url in API response as : \`[download/attachments/684556356/Screen%20Shot%202019-10-11%20at%203.19.28%20PM.png?version=1\&modificationDate=157787674135\&cacheVersion=1\&api=v2](https://api.atlassian.com/ex/confluence/%7BcloudId%7D/rest/api/download/attachments/684556356/Screen%20Shot%202019-10-11%20at%203.19.28%20PM.png?version=1&modificationDate=157787674135&cacheVersion=1&api=v2)\`  

Tried to this with Oauth 2.0 3LO access token.  
but received 401  
what would be the base Url   
I tried using : [https://api.atlassian.com/ex/confluence/{cloudId}/rest/api/](https://api.atlassian.com/ex/confluence/%7BcloudId%7D/rest/api/download/attachments/684556356/Screen%20Shot%202019-10-11%20at%203.19.28%20PM.png?version=1&modificationDate=157787674135&cacheVersion=1&api=v2)


author: Anuja Deshpande
body: I tried hitting this request on postman with Oauth 2.0 3LO access token  
1. sent API request for get page attachment  
2. received download url in response   
3. tried to hit this using Oauth 2.0 access token


author: Anuja Deshpande
body: Request for getting page attachment :  

<br />

<https://api.atlassian.com/ex/confluence/{cloudId}/rest/api/content/{pageId}?expand=children.comment,children.attachment>  

received download url in response  

tried to hit that using \`<https://api.atlassian.com/ex/confluence/{cloudId}/rest/api>\` as base url


author: Danila Zharenkov
body: [@Anuja Deshpande](/t5/user/viewprofilepage/user-id/3407625) did you find any solution for that?


Tags: cloud

confluence-cloud