Skip to content

RestUserCategory

stockiNail edited this page May 24, 2017 · 7 revisions

User services category

The user service category gives you the capability to have a stateful connection (by REST) with JEM, getting user info, login and logoff the session and manage the user preferences.

Getting user info

Provides the current user if logged on JEM by this http session.

Request
Parameter Value
URL /user/get
Method GET
Path none
Query none
Content-Type application/json
Accept-Type application/json
Body none
Response
Status code Description
200 OK - Returns the logged user info
404 Not Found - The session doesn't have any logged user
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available.

Logging in

Allows to login (by userid and password) to the JEM and sets the authenticated user to the current HTTP session.

Request
Parameter Value
URL /user/login
Method PUT
Path none
Query none
Content-Type application/json
Accept-Type application/json
Body The account information
Response
Status code Description
200 OK - Returns the logged user info
401 Unauthorized - The account of user is incorrect
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available

Logging off

Allows to logoff from JEM and removing the authenticated user from the current HTTP session.

Request
Parameter Value
URL /user/logoff
Method DELETE
Path none
Query none
Content-Type application/json
Accept-Type text/plain
Body none
Response
Status code Description
200 OK - Returns "true" if it was able to logged off otherwise "false"
401 Unauthorized - The account of user is incorrect
500 Internal Server Error - The service had an exception
503 Service Unavailable - JEM cluster is not available

Body format

This section described the JSON format of the BODY parameters to use in the requests and the BODY responses.

Account

To login into JEM, you need to provide the userid and password, using the following format:

{
  "userid" : "userid",
  "password" : "password"
}
User Info

JEM provides some information about a user logged into JEM, using the following format:

{
  "id" : "userid",
  "name" : "name of user",
  "authorized" :  {
    "permission1" : true or false,
    ....
    "permissionN" : true or false,
  },
  "preferences" : null,
  "organizationalUnit" : {
    "id" : "group id",
    "name" : "name of group"
  }
}
Clone this wiki locally