Difference between revisions of "REST Interface"
Philip Kahle (Talk | contribs) (→Collections) |
Philip Kahle (Talk | contribs) (→Login) |
||
Line 8: | Line 8: | ||
* The HTTP header as cookie named "JSESSIONID" | * The HTTP header as cookie named "JSESSIONID" | ||
* The request parameter "JSESSIONID" | * The request parameter "JSESSIONID" | ||
+ | For testing the service methods in the browser, there is a similar login method that works via GET:<br/> | ||
+ | <code>https://transkribus.eu/TrpServer/rest/auth/login_debug?user={username}&pw={password} | ||
=Collections= | =Collections= |
Revision as of 09:37, 10 September 2015
The Transkribus application communicates with the server via a set of RESTful service methods. The complete definition can be found in the file application.wadl. The parameters for all the methods described below can be found in that service description file.
Login
Most of the methods require the user to be logged in to the services which is achieved by POSTing the user credentials to the login method:
https://transkribus.eu/TrpServer/rest/auth/login
The method returns an XML with the user profile and the collections that are allowed to be accessed by this user.
Subsequent requests to the service must then include the Session-ID from the XML either in:
- The HTTP header as cookie named "JSESSIONID"
- The request parameter "JSESSIONID"
For testing the service methods in the browser, there is a similar login method that works via GET:
https://transkribus.eu/TrpServer/rest/auth/login_debug?user={username}&pw={password}
Collections
Once a user is authenticated, the collections, for which the user has access rights, can be listed via the following calls:
- <code>https://transkribus.eu/TrpServer/rest/collections/list.xml
-
https://transkribus.eu/TrpServer/rest/collections/list
(JSON output)
The call returns a list with collections, where each object contains the collection-ID, collection name and the role of the current user in this collection.
Documents in a collection can be listed analogously via GET request:
-
https://transkribus.eu/TrpServer/rest/collections/{collection-ID}/list.xml
-
https://transkribus.eu/TrpServer/rest/collections/{collection-ID}/list
This call returns a list of document metadata objects.
In order to retrieve a complete document, one has to GET the following:
-
https://transkribus.eu/TrpServer/rest/collections/{collection-ID}/{document-ID}/fulldoc.xml
-
https://transkribus.eu/TrpServer/rest/collections/{collection-ID}/{document-ID}/fulldoc
The returned object is made up of the document metadata and the complete page list where each page contains among other attributes:
- A link to the page image
- A list of transcript files where each transcript contains:
- A link to the page XML file
- The responsible user's ID and name
- A timestamp
- The status of the transcript, e.g. NEW, IN_PROGRESS, DONE, FINAL