Skip to end of metadata
Go to start of metadata

As REST is based on the usage of HTTP, so it's very simple to use. You can call a REST service in any languages, with the help of nuxeo-http-client or even in just a simple web browser.

This tutorial aims at presenting the mains REST services usables in Nuxeo, and how to use them to create, update, delete a document or look up in the repository.

Usage

Each service looks for parameters presents in the url, for example:

The url is composed with three parameters which are :

  • {repo} : Name of the repository
  • {docid} : ID of the document, you can get it from the url when you navigate in nuxeo. Every element in the repository as an ID : Document, Workspace, Section
  • {filename} : File name of the file to upload

You need to be log to nuxeo in order to use the REST services via a browser.

The main services

createDocument Service

This service allows to create documents in the repository.

Usage: http://server:port/nuxeo/restAPI/\{repo}/{docid}/createDocument?documentsProperties

example :

Just replace the docid whith the id of a workspace or folder and drop the url in your browser.

You will get this.

Unknown macro: {image}

As you see, the document as been created.

Unknown macro: {image}

export

Allow to get a full description of a document.

usage : http://server:port/nuxeo/restAPI/

Unknown macro: {repo}

/

Unknown macro: {docid}

/export

example : http://127.0.0.1:8080/nuxeo/restAPI/default/c800c2f2-b834-4751-b362-db821d5ce30b/export?format=tree

A you see, i look for the document salary that we just created.

Unknown macro: {image}

opensearch

opensearch allows to make full text research on the repository.

Usage : http://127.0.0.1:8080/nuxeo/restAPI/opensearch?q=salary

Result :

Unknown macro: {image}

updateDocument

This restlet allows to change simples properties.

exemple : http://127.0.0.1:8080/nuxeo/restAPI/default/c800c2f2-b834-4751-b362-db821d5ce30b/updateDocumentRestlet?dublincore:description=No%20comment

It will change our document description to "no comment"

Unknown macro: {image}

deleteDocument

exemple : http://127.0.0.1:8080/nuxeo/restAPI/default/c800c2f2-b834-4751-b362-db821d5ce30b/deleteDocumentRestlet

workflowTasks

workflowTasks allows to export all the tasks in progress.

example : http://127.0.0.1:8080/nuxeo/restAPI/workflowTasks/default/?format=xml

Unknown macro: {image}
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.