-
Notifications
You must be signed in to change notification settings - Fork 1
Api Common Parameters
Every field of a resource can be used as filter by the relational operator =
. Numeric values also admit >
and <
.
GET /documents?words.size>100
This returns the list of documents with more than 100 words.
Every resource can be filtered by other resource (singular and lower-case) as related, so:
GET /documents?domain=1488437
will return the list of documents in the domain with uri: domains/1488437
.
Allows ascending and descending sorting over multiple fields
GET /documents?sort=-title,+published
This returns a list of documents sorted by descending titles and ascending publication dates.
Maybe you need more attributes than default. Using the fields
parameter you can choose among all available fields of the resource:
GET /documents?fields=title,creators,published,uri
Also, every resource can include other related resource by adding the name of the resource (singular and lower-case):
GET /documents/34234235?fields=title,domain
This return the title of the document and the list of domains where it is contained.
-
offset
: specific page to be returned. Default is 0. -
limit
: max number of resources by page. Default is 20.
GET /documents?offset=2&limit=20
The number of total entries is sent in the X-Total-Count
HTTP header.
Links to the next or previous page are provided in the HTTP header link:
Link: <http://../documents?offset=2&limit=10>; rel="next",<http://../documents?offset=20&limit=10>; rel="last"
System uses HTTP Standard codes and the exact error is explained in the error payload:
- 400 - Bad Request: The request was invalid or cannot be served
{
"message": "Parameter: 'xxxx' does not exist",
"code": 34,
"moreInfo": "http://.../errors/34"
}
work supported by the European Community's Seventh Framework Programme (FP7-ICT-2013-8.1) under grant agreement no: 611383. For further information please see http://DrInventor.eu