Web Services Definition » History » Revision 17
Revision 16 (Kurt Gerber, 13 Dec 2018 14:52) → Revision 17/40 (Kurt Gerber, 13 Dec 2018 15:41)
h1. API / Web Services Requirements h2. Request services The existing API is documented here: https://qcat.readthedocs.io/en/latest/api/docs.html h3. Required missing request services: * There is an endpoint to get the configuration for a specific questionnaire and edition: https://https://qcat.wocat.net/en/api/v2/configuration/technologies/2018/ 1. Whithout the 'edition' endpoint, it should response with an array of available editions. Now it answers with a 'Not found' html page. 2. Without the specific configuration endpoint (like 'technologies'), the response should be an array of available configurations. Now it answers with a 'Not found' html page. h2. Requirements for services to add / update cases The following new webservice endpoints must be developed. h3.1. h3. Authentification endpoint To upload a case, a user has to authenticate himself. Therefore an authentification endpoint is needed. %{background:#F2D5A0} The existing authorization token serves only as authorization to access the API. The token is application based and always the same for a certain application, independently of the user working with the application.% *Endpoint:* _/api/v2/auth-token/_ *Allowed method:* _POST_ *Post data:* @username@: The username of a WOCAT account @password@: The password of the corresponding WOCAT account * The user has to authenticate before any data is uploaded or non-public downloaded. * After a successfull authentification, the server sends a 'sessionid'. (session-) token. This sessionid token has to be added to the request header sent for any subsequent POST request. Should work a bit as * This token should have limited time of validity on the web UI with the sessionid in the cookie. server side. * LImitations on client side? (to discuss) *Endpoint:* _/api/v2/user-token/_ *Allowed method:* _POST_ *Post data:* * @username@: The username of a WOCAT account * @password@: The password of the corresponding WOCAT account *Response:* * @ {"sessionid":"09249249243729342123ad232dc"}@ h3. 2. Upload endpoint *Endpoint:* @/api/v2/create/<configuration>/<edition>@ *Allowed method:* @POST@ *POST data:* a valid questionnaire based on the corresponding "configuration template":https://qcat.readthedocs.io/en/latest/api/v2.html#structure-of-configuration *Request Header: * @Authorization: Token AUTH_TOKEN@ * @sessionid: 6xn26rwsy0r0k2yn5bsoq2qiyssg9mrs@ * @Accept: application/json@ or @Accept: application/xml@ * @Content-Type: application/json@ or @Content-Type: application/xml@