How to create folder under a specific site and library using REST API?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

How to create folder under a specific site and library using REST API?

hi All,

I have been using Alfresco for past couple of weeks and it is a really great experience.

I use the below POST query along with the parameters to create documents via REST.

hxxp://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children 

However, the above creates the document under root folder. But, I need to create a document on specific site/documentLibrary/folder. 

I have seen this reference but not cannot figure out how the altimate URL should look like.

Create child folder | Alfresco Documentation 

How would l be able to do that pass all three arguments?

Please let me know and thank you in advance,

4 Replies
Highlighted
Master

Re: How to create folder under a specific site and library using REST API?

That documentation link points to an internal ReST API which should not be used for custom, external integrations. That API is used primarily for the Share user interface. As such, the operation may be removed in a future version of Alfresco (undetermined as of yet) when Share is finally removed.

The public v1 ReST API has its specific operation to retrieve a site container (i.e. documentLibrary), and with the container folder in hand you can then use the regular API to create a child in there.

P.S.: In the future, please make a selection of the categories - don't just check every single one of them, even though most don't make sense for the question.

Highlighted
Active Member

Re: How to create folder under a specific site and library using REST API?

Thanks a lot for the quick reply.

Just one more question, Having the container, would I be able to create folder in it? Which API should I use for that one?

Regards,

Highlighted
Master

Re: How to create folder under a specific site and library using REST API?

The one API you already listed, i.e. /alfresco/api/-default-/public/alfresco/versions/1/nodes/[nodeIdOfContainer]/children

I am wondering: Are you using the documentation / publicly available API explorer to find your way around the ReST API? It should be quite straightforward to connect which operations you can use for your specific use cases by looking at that.

Highlighted
Professional

Re: How to create folder under a specific site and library using REST API?