How to Upload File and Bind him to Document Using the REST API and Download File Attached to Documents Using the REST API

Are the following documents are up to date: https://www.nuxeo.com/blog/qa-friday-download-files-attached-documents-rest-api/ and https://www.nuxeo.com/blog/qa-friday-upload-files-documents-rest-api/?

Please correct me if I am wrong. Currently I have successfully uploaded file using three rest api steps with POSTMAN:

1. create batchId with http  POST   http://<DOMAIN>/nuxeo/api/v1/upload/
2. upload file  POST http://<DOMAIN>/nuxeo/api/v1/upload/<batchId>/idx
3. Create document POST http://10.204.20.153/nuxeo/api/v1/id/de72f8e6-348e-477b-8824-9b1c157b4f7d
    {
        "entity-type": "document", 
        "name":"nameOfDocument", 
        "type": "File",
        "properties": { 
            "dc:title": "Title", 
            "dc:description": "Created via a so cool and simple REST API", 
            "file:content": {
                "upload-batch":<batchId>,
                "upload-fileId":idx
            }
        }
    }

What is difference between POST http://localhost:8080/nuxeo/api/v1/upload/

What should I use? Is anyone can provide some examples(any programming language) with uploading file and binding to the document and download file attached to the document. Any help will be appreciated.

0 votes

0 answers

1916 views

ANSWER

Please disregard my question.
05/14/2018