05-14-2021 02:54 AM
Hi Everyone,
I have requirement of Creating folder hierarchy using REST API. I am able to create single single folder using following call:-
http://localhost:8080/alfresco/service/api/site/folder/Test/documentLibrary/Test 1
i want my folder hierarchy as follows:-
Site:- Test Container:- documentLibrary folder hierarchy as :- Test 1/Test 2/Test 3/Test 4.
i am able to acheive it by running it again and again but want it in one go.
Also like i am able to create folders using content create API by providing relative path by using below call:-
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children relativepath as:- test/documentLibrary/test1/test2/test3/test4 also by providing filedata and nodetype. but i want only folder hierarchy without content.
can i create folder hierarchy anyway by using relative path?
Please do guide me out on this.
Thanks and Regards,
Piyush.
05-14-2021 07:59 AM
There is no way to create a hierarchy in just one call. You have to call it multiple times.
05-14-2021 08:40 AM
Hi @afaust ,
Is there anyway such task can be acheive through CMIS API call?.
Any other way possible for this without using Alfresco API services ? cause i am creating standalone java application for it.
Thanks,
Piyush.
05-14-2021 09:13 AM
No - AFAIK there are no standard APIs that you can use to create an entire path in one call. You would have to create a custom web script / action for that. The latter could be triggered via Alfresco ReST API as far as I know (I have never done / tried that myself).
04-01-2022 10:22 AM
Hi,
If I understand correctly the question, i think it is now possible.
The Api explorer doc says :
"The relativePath specifies the folder structure to create relative to the node nodeId. Folders in the
relativePath that do not exist are created before the node is created."
I have tried this and the folders are all well created in one call....
Best regards
Explore our Alfresco products with the links below. Use labels to filter content by product module.