\BlueLaTeX

Real-Time Collaborative Document Edition

View project onGitHub

Session API

Api Summary

Method Path Description
POST /<api>/session Logs user in
GET /<api>/session Gets the current session data
DELETE /<api>/session Logs user out

Log User In

Method: POST

Path: /<api>/session

Parameters:

Name Type Description
username string The user name mandatory
password string The user password mandatory

Response:

Code Value Meaning
201 true The user was successfully logged in
400 error object Some parameters are missing
401 error object The authentication failed
500 error object Something wrong happened on the server side and the user could not be registered

Get Session Data

Method: GET

Path: /<api>/session

Response:

Code Value Meaning
200 session object The session data
401 error object User is not logged in
500 error object Something wrong happened on the server side

The session data object is as follows:

{
  "name": "glambert",
  "roles": [ "blue_user" ]
}

Log User Out

Method: DELETE

Path: /<api>/session

Response:

Code Value Meaning
200 true The user was successfully logged out
500 error object Something wrong happened on the server side and the action could not be performed