API Methods

Login
login
Post
group
Request
group
student
timetable
search

Lab Remote Services

Overview

This API provides communication between the middleware server and the application.
We used JSON web services for posts and requests.

Request
A basic request sends a message to the server at the corresponding url. The server sends a confirmation message back.

If the request succeded.
 {
   "status" : "success",
   /* The JSON requested data */
 }
If there was an error with resolving the request.
 {
   "status" : "failed",
   "error" : "The error message"
 }

Post
The user sends its post message at "/post" url.

Each request contains a number of key-value pairs:
course: course name
user_id: the assistant's id
contents: the encoded json data
type: type of query hash: signature
The post signature is obtained by applying a md5 function on the following string
made of the post data and the secret string:
"course_nameassistant_idcontentstypesecret_code"
The server replies with a json string to announce if the post succedeed or not.