cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco API Doucment Upload

eddiesmith
Champ in-the-making
Champ in-the-making

Hi I am new to alfresco and not sure if I am looking in the right place but I'm not able to find a way to upload a local document to a folder in alfresco using Rest API calls. If you have done so before, I would appreciate the help!

4 REPLIES 4

fedorow
Elite Collaborator
Elite Collaborator

Create a node as child of the folder using the POST ​/nodes​/{nodeId}​/children

Update binary content using the PUT /nodes/{nodeId}

eddiesmith
Champ in-the-making
Champ in-the-making

Thank you for your response. Could you elaborate more or direct me to any documentation/ post that would help me? Thanks

fedorow
Elite Collaborator
Elite Collaborator

If you have api explorer installed go to http://<your_alfresco_domain>/api-explorer/#/nodes.

If not, look at public one: https://api-explorer.alfresco.com/api-explorer/

Explorer have a lot of comments and could be easy understandable. The documentation is here: https://docs.alfresco.com/content-services/latest/develop/rest-api-guide/

Long words short: Find nodeID of your folder. Create a document as a child in this folder by POST ​/nodes​/{folder_nodeId}​/children. If sucsess you will get json respons with new document (node) id.

Upload the content of this new document by PUT /nodes/{document_nodeId}.

ash_saxena10
Confirmed Champ
Confirmed Champ

Hi

You can use below Rest api call to upload the file/document to alfresco . 

http://<hostname>:<port>/alfresco/api/-default-/public/alfresco/versions/1/nodes/{id}/children

Below Link will explain you about the above Rest api call , its Request Body and its all necessary parameters . 

https://docs.alfresco.com/content-services/latest/develop/rest-api-guide/folders-files/#uploadfile

Please refer below snapshot from Postman for uploading content to alfresco .

image