How to

GETting a document

mandatory HTTP headers:

  • Accept: "application/xml" or "application/json".

To get a document it is used the Http GET verb on the Uri of the document to retrieve. A document can be retrieved in three different ways:

  1. single node
  2. complete document
  3. partial document

The single node retrieval is performed by default when the document Uri is used in the request.

To retrieve the whole document (i.e. the root node and each and every node with an aggregation dependency) a "/" character is appended at the end of the Uri.

To retrieve a partial document it is used the partial resolution parameter, $r followed by an integer representing the number of hops the resolution must go through.

In every case it is possible to ask a sub-resource of the node itself using the parameter $p followed by the sub-resource inner path.

For example it is possible to ask only the IDNMeta section of a node, or ask the IDNMeta section of a set of nodes chaining the parameters.

Please note the VR has a "best effort" behaviour: even if the request can not be completely satisfied it is returned as much information as possible.

PUTting a document

mandatory HTTP headers:

  • Accept: "application/xml" or "application/json".
  • Content-Type: "application/xml" or "application/json".

It is possible to perform a write operation (i.e. creating nonexistent document or updating an existing one) using the PUT http verb on the Uri of the document to write.

To perform a write operation it is mandatory to set the IsRoot tag of each and every node contained in the request body. If the write is called with the update semantic it is mandatory to set the node etag value.

To update an existing document only the sub-resources to be updated must be declared in the request body (smart PUT).

Please note the VR has a "best effort" behaviour: even if the request can not be completely satisfied it will be written as much information as possible.

DELETEing a document

It is possible to perform a removal operation using the DELETE http verb on the Uri of the document to remove.

It is not possible to remove more than one node at time, only the node associated with the request Uri will be deleted when such operation is invoked.