Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Session Api

Lucas Satabin edited this page Dec 22, 2013 · 2 revisions

Api Summary

Method Path Description
POST /session Log user in
GET /session Get the current session data
DELETE /session Log user out

Log User In

Mehtod: POST

Path: /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

Mehtod: GET

Path: /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

Mehtod: DELETE

Path: /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
Clone this wiki locally