Hello,
I’m trying to get the attachments of a page using the API. I’m using an API key, and to get a list of attachments i’m calling:
https://{company}.atlassian.net/wiki/rest/api/content/{pageID}/child/attachment
Once I get the attachment ID, I download it (this time using OAuth2 / 3LO) with
https://api.atlassian.com/ex/confluence/{cloudID}/rest/api/content/{pageID}/child/attachment/{attachmentID}/download
The results are correct. However, the first call returns all the attachments of all the versions of the page, not just the current version. For example, say the page has the following attachments
- Page version 1:
- Image1.jpg
- Image2.jpg
- Image3.jpg
- Image4.jpg
- Page version 2 (current):
- ImageAlbum.pdf (the images were deleted and merged into a single file)
The results includes all 5 files. However, our app should see only the most recent one (in this case ImageAlbum.pdf). The attachment objects returned don’t have any mention of the version of the parent page where they are located, so I can’t filter them either.
Is there a way to obtain the attachments of just the last version of a page using the API? Alternatively, with the ID of the page and the attachment, can I check if the attachment is present in the last version of the page?