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

Session Api

Audric Schiltknecht edited this page Dec 22, 2013 · 2 revisions

Api Summary

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

Log User In

Method: 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

Method: 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

Method: 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