This repository has been archived by the owner on Oct 8, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Session Api
Audric Schiltknecht edited this page Dec 22, 2013
·
2 revisions
Method | Path | Description |
---|---|---|
POST | /session | Logs user in |
GET | /session | Gets the current session data |
DELETE | /session | Logs user out |
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 |
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" ]
}
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 |