You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I'm trying to figure out how to get a list of all the versions of an attachment using the rest api. In particular, the version number, date and time of each version. I've tried variations on the rest api url, but haven't had much luck. I'm probably making a simple mistake.
Things I've tried:
rest/api/content/<Attachment ID>/history
rest/api/content/<Page ID with attachments>/descendant?expand=attachment
rest/api/content/<Page ID with attachments>/child/attachment?expand=container,operations,children,restrictions,history,version,descendants,space
Thank you,
R
All attachments is also a representative of the "content" like a page.
So, endpoint GET /wiki/rest/api/content/{id}/version is also available for attachments.
For attachment with id att1769484 you can request
curl --request GET \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/att1769484/version' \
--user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
I was able to do it using the solution described here: https://confluence.atlassian.com/confkb/how-to-retrieve-all-previous-versions-of-content-using-the-rest-api-1044789048.html
The URL to use is: /rest/experimental/content/{id}/version/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thats not working, also i need to list old versions to download and migrate to other platform. I tried all i saw
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello R,
From reviewing your notes and the endpoints you’ve attempted, you should be able to get what you need from the last endpoint you listed. This endpoint should be able to provide what you’re looking for with the expands:
GET /rest/api/content/{id}/child/attachment
Example of what to use: http://example.com/confluence/rest/api/content/1234/child/attachment?filename=myfile.txt&expand=version
This should give your information in a format which will include version and when (this is the date).
Please let us know if this example is helpful in getting your attachment information.
Regards,
Stephen Sifers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
but if the document has n versions for example 9 versions .. how can I list when each version was last updated.....or created....
I found
https://xxxxxxxxx.atlassian.net/wiki/rest/api/content/xxxxxxxxxx/child/attachment?expand=history.lastUpdated,history.previousVersion&version=1
but just list the previous version of the current one
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.