How to migrate folders data to confluence through API?
I solution suggested by Atlassian is to create a single page in a Confluence page containing ALL attachments of the page & not adding attachments to other pages.
While this is hard to change when you have a running aged system, this is not a bad idea:
1. You won't have any problems with the same file attached more than once.
2. You save storage (because of 1.)
3. You've got a single point of reference for attachments
4. Easy implementation via REST as single page reference & no need to create page before
Tag your attachments with labels to filter them with attachment macros on overview pages:
https://confluence.atlassian.com/doc/attachments-macro-97911315.html
This is a better way in the long run, I just fixated on the "hierarchy" asked for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Files in Confluence are attached to pages, they are not independently stored.
To get a hierarchy or structure, you need to create pages in the shape you want for the structure (see https://community.atlassian.com/t5/Confluence-questions/create-tree-structure-in-confluence/qaq-p/921706 for a very recent discussion on that), and then attach files to the appropriate pages.
To do that via the API, see https://docs.atlassian.com/ConfluenceServer/rest/6.12.1/#content/{id}/child/attachment
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.