Client SDKs

Using cURL

Updated: December 2, 2016 Page Information Edit on GitHub

This page is scheduled for review and update. Check back soon for updated content!

In this example we are using the UNIX curl command line tool to demonstrate how to invoke remote operations.

In a Windows environment, Nuxeo recommends to use cygwin shell to avoid all formatting request issue using default shell like Powershell

  1. Here is how to create a new File document type on the Nuxeo demo instance, right under the default domain (you can copy, paste and test):

    curl -X POST -H "Content-Type: application/json" -u Administrator:Administrator -d '{ "entity-type": "document", "name":"newDoc", "type": "File","properties": { "dc:title": "Specifications", "dc:description": "Created via a so cool and simple REST API", "common:icon": "/icons/file.gif", "common:icon-expanded": null, "common:size": null}}' https://nightly.nuxeo.com/nuxeo/api/v1/path/default-domain
    
  2. You can get the new resource doing a standard GET (actually the JSON object was already returned in previous response):

    curl -X GET -u Administrator:Administrator  http://demo.nuxeo.com/nuxeo/api/v1/path/default-domain/newDoc
    
  3. Now, "lock" this document we have just created by calling an Automation operation from command API on the document resource.

    curl -X POST -H "Content-Type: application/json+nxrequest"   -u Administrator:Administrator -d '{"params":{}}'  https:[email protected]/Document.Lock
    

    Pay attention to the Content-Type that is specific when using the @op adapter.

    You can check the result of your request on the web app (https:[email protected]_domains, credentials:  Administrator/Administrator).

  4. You can also directly call an automation operation or chain, from the "Command endpoint". Here we return all the worskpaces of the demo.nuxeo.com instance:

    curl -H 'Content-Type:application/json+nxrequest' -X POST -d '{"params":{"query":"SELECT * FROM Document WHERE ecm:primaryType=\"Workspace\""},"context":{}}'   -u Administrator:Administrator https://nightly.nuxeo.com/nuxeo/api/v1/automation/Document.Query
    

6 months ago Andrew Goodricke Add content-review-lts2016 to labels
7 months ago Kevin Leturc NXP-19481: Update MarkLogic page to detail how to configure range element indexes
8 months ago Benoit Delbosc 17 | ix the Lock url by adding a missing "/
3 years ago Laurent Doguin 16
4 years ago Solen Guitter 15
4 years ago Vladimir Pasquier 14
4 years ago Solen Guitter 13
5 years ago Arnaud Kervern 11
5 years ago Arnaud Kervern 12 | Migrated to Confluence 4.0
6 years ago Bogdan Stefanescu 10 | example is not working when using '*' - server side exception
7 years ago Stéfane Fermigier 9
7 years ago Stéfane Fermigier 8
7 years ago Stéfane Fermigier 6
7 years ago Stéfane Fermigier 7
7 years ago Stéfane Fermigier 5
7 years ago Bogdan Stefanescu 4
7 years ago Bogdan Stefanescu 3
7 years ago Bogdan Stefanescu 2
7 years ago Bogdan Stefanescu 1
History: Created by Bogdan Stefanescu