-
Notifications
You must be signed in to change notification settings - Fork 7
API Documentation
This document presents all the functionalities provided by the API Extended Document. This API is available on this server.
Note:
In the following, we consider that the default route is http://rict.liris.cnrs.fr:9095
.
However if you do not want to use this server, you can run your own localhost server by following
these instructions.
The routes presented in the following will remain valid.
Method | Route | Description |
---|---|---|
POST |
/addDocument | Creation of a new document |
GET |
/getDocument/doc_id |
Get the document with the id value is doc_id
|
GET |
/getDocuments | Get all documents matching some criteria |
POST |
/editDocument/doc_id |
Edit the document with the the id doc_id
|
GET |
/deleteDocument/doc_id |
Delete the document with the id doc_id
|
GET |
/uploadFile/doc_id |
Redirection to update file |
POST |
/uploadFile/doc_id |
Update the file associated to the document doc_id
|
GET |
/getFile/filename |
Download filename from the server |
Method | Route | Description |
---|---|---|
GET |
/addGuidedTour | Creation of a guided tour |
GET |
/getGuidedTour/tour_id |
Get the guided tour with the id tour_id
|
GET |
/getGuidedTours | Get the guided tours matching some criteria |
GET |
/addDocumentToGuidedTour | Add a document to a guided tour |
POST |
/editGuidedTour/tour_id |
Edit the guided tour with the id tour_id
|
POST |
/editGuidedTourDocument/tour_id |
Edit a document associated with tour_id
|
GET |
/deleteGuidedTour/tour_id |
Delete the tour with the id tour_id
|
Code | Description |
---|---|
200 | Everything is fine |
204 | No result were found |
400 | At least one parameter is missing |
404 | The resource does not exist |
405 | Method not allowed |
422 | SQL integrity error (not null, etc.) |
500 | An internal error happen |
Note: The type date is just a string with a certain format: aaaa-mm-dd
POST
/addDocument
- Create a new document with the values passed in parameters. Some of these parameters are needed.
- Return the document just created in a JSON format.
Any parameter can be added in the request, but only those who are effectively present in the document model will be taken into account:
Needed | Parameter | Type | Description |
---|---|---|---|
✔️ | title | string | title of the document |
✔️ | subject | string | subject of the document |
✔️ | description | string | description of the document |
❌ | refDate | date | date references the content of the document |
❌ | publicationDate | date | date when the document was published |
❌ | type | string | type of the document (pdf, png, etc.) |
❌ | quaternionX | float | X axis of the rotation of the document |
❌ | quaternionY | float | Y axis of the rotation of the document |
❌ | quaternionZ | float | Z axis of the rotation of the document |
❌ | quaternionW | float | W axis of the rotation of the document |
❌ | positionX | float | X axis of the coordinates of the document |
❌ | positionY | float | Y axis of the coordinates of the document |
❌ | positionZ | float | Z axis of the coordinates of the document |
Go back to the list of functionalities
GET
/getDocument/{doc_id}
- Return the document whose the id is equal to
doc_id
.
Name | Type | Description |
---|---|---|
doc_id | Integer | Id of the document |
Go back to the list
GET
/getDocuments
- Return a list of documents matching the criteria, given in parameter
Needed | Parameter | Type | Research | Description |
---|---|---|---|---|
❌ | title | string | attributes | title of the document |
❌ | subject | string | attributes | subject of the document |
❌ | description | string | attributes | description of the document |
❌ | refDate | date | temporal | date references the content of the document |
❌ | publicationDate | date | temporal | date when the document was published |
❌ | keyword | date | keyword | keyword on which we make the research |
On a date attribute, it is possible to make a temporal research, which means, we can specify an interval on whom we make the research. To do that, we simply add one of the special characters <
and >
after the name of the attribute. For instance, if we want all the documents with a refDate between the 12/07/1998 and the 15/07/2018 we can make the request:
../getDocuments?refDate>=1998-07-12?refDate<=2018-07-15
We have four new parameters:
Needed | Parameter | Type |
---|---|---|
❌ | refDate< | date |
❌ | refDate> | date |
❌ | publicationDate< | date |
❌ | publicationDate> | date |
Go back to the list
POST
/editDocument/{doc_id}
- Update the content of the document whose the id is equal to
doc_id
. - Return the updated document.
Name | Type | Description |
---|---|---|
doc_id | Integer | Id of the document |
Needed | Parameter | Type | Description |
---|---|---|---|
❌ | title | string | title of the document |
❌ | subject | string | subject of the document |
❌ | description | string | description of the document |
❌ | refDate | date | date references the content of the document |
❌ | publicationDate | date | date when the document was published |
❌ | type | string | type of the document (pdf, png, etc.) |
❌ | quaternionX | float | X axis of the rotation of the document |
❌ | quaternionY | float | Y axis of the rotation of the document |
❌ | quaternionZ | float | Z axis of the rotation of the document |
❌ | quaternionW | float | W axis of the rotation of the document |
❌ | positionX | float | X axis of the coordinates of the document |
❌ | positionY | float | Y axis of the coordinates of the document |
❌ | positionZ | float | Z axis of the coordinates of the document |
Go back to the list
POST
/deleteDocument/{id of the document}
Delete the document whose the id is equal to doc_id
Name | Type | Description |
---|---|---|
doc_id | Integer | Id of the document |
Go back to the list
GET
/uploadFile/{doc_id}
- Redirect on an html page from whom we can upload a file to the server
- When we push the button
upload
it will send the post request just below. - The file is send using
form data
POST
/uploadFile/{doc_id}
- Upload to the server a file, it will be save as
{doc_id}.{ext}
whereext
is the extension of the original file.
Go back to the list
GET
getFile/{filename}
- Download the file, if it exists, located in the server whose name is
filename
Name | Type | Description |
---|---|---|
filename | string | name of the file to get |
Go back to the list
GET
/addGuidedTour
- Create a new guided tour with the values passed in parameters.
- Return the guided tour just created in a JSON format.
Needed | Parameter | Type | Description |
---|---|---|---|
✔️ | name | string | Name of the guided tour |
✔️ | description | string | Description of the guided tour |
Go back to the list of functionalities
GET
/getGuidedTour/{tour_id}
- Return the guided tour whose the id is equal to
tour_id
.
Name | Type | Description |
---|---|---|
tour_id | Integer | Id of the document |
Go back to the list
GET/POST
/getGuidedTours
- Return all guided tours
Go back to the list
GET
/addDocumentToGuidedTour
- Add the document whose id is equal to
doc_id
to the guided tour whose the id is equal totour_id
. - Return the updated guided tour
Needed | Parameter | Type | Description |
---|---|---|---|
✔️ | tour_id | string | ID of the guided tour |
✔️ | doc_id | string | ID of the document |
Go back to the list
GET
/editGuidedTour/tour_id
- Update the guided tour whose the id is equal to
tour_id
- Return the updated guided tour
Name | Type | Description |
---|---|---|
tour_id | Integer | Id of the guided tour |
Needed | Parameter | Type | Description |
---|---|---|---|
✔️ | name | string | Name of the guided tour |
✔️ | description | string | Description of the guided tour |
Go back to the list
POST
/editGuidedTourDocument/tour_id
Name | Type | Description |
---|---|---|
tour_id | Integer | Id of the guided tour |
Needed | Parameter | Type | Description |
---|---|---|---|
✔️ | doc_position | integer | Position of the document in the guided tour |
❌ | text1 | string | information text 1 about the document |
❌ | text2 | string | information text 2 about the document |
❌ | title | string | title of the document in the guided tour |
Go back to the list
GET
/deleteGuidedTour/tour_id
- Delete the guided tour whose the id is equal to
tour_id
Name | Type | Description |
---|---|---|
tour_id | Integer | Id of the guided tour |
Go back to the list
The names of the routes are not relevant and do not respect the REST specifications. They should have been like this:
Method | Route | Description |
---|---|---|
POST |
/document | Creation of a new document |
GET |
/document | Get all documents matching some criteria |
GET |
/document/doc_id |
Get the document with the id value is doc_id
|
PUT |
/document/doc_id |
Edit the document with the the id doc_id
|
DELETE |
/document/doc_id |
Delete the document with the id doc_id
|
Method | Route | Description |
---|---|---|
POST |
/guidedtour | Creation of a guided tour |
POST |
/guidedtour/tour_id /document |
Add a document to the guided tour tour_id
|
GET |
/guidedtour | Get the guided tours matching some criteria |
GET |
/guidedtour/tour_id |
Get the guided tour with the id tour_id
|
PUT |
/guidedtour/tour_id |
Edit the guided tour with the id tour_id
|
PUT |
/guidedtour/tour_id /document |
Edit a document associated with tour_id
|
DELETE |
/guidedtour/tour_id |
Delete the tour with the id tour_id
|