Using the Request Manager REST API

Development users of Request Manager v3.5.0 and above can use REST API calls that invoke the potential owner recalculation. This way, the user does not have to navigate through the user interface. .

This page includes the following:

Post Call for Adding Potential Owners Recalculation

Request: POST URL: localhost:8080/jrm/rest/applications/recalculation/add

{

    "userId": "testUser",     

    "groupId": ["groupId1","groupId2"],     

    "rolesEx":[                        

        {"role":"nexus","request":"Admin"}

        ,                

        {"role":"userproxy","request":"Admin"}

    ],

    "recalculate":"true"

}

Parameters

  • role: specific role, which will be assigned to user
  • request: (PU name) request name where the role is specified

Note: If not specified, the default value for recalculate is false.

Excepted Outputs Results for POST Calls

The following results are for the same for adding or removing Potential Owners Recalculation.

200 - OK

401 - The wrong user credentials used for authentication

403 - User has no rights to do the call.

In Request Manager log:

[ERROR][http-nio-8080-exec-16] testUser@lrm.local 2019-07-25 14:43:54,056 com.levatis.lrm.ws.ApplicationRestAPI.permisionCheck(): User testUser@lrm.local has no sufficient rights for this action.

404 - The Wrong userId or incorrect @path parameter in URL (ADD/REMOVE)

in JRM log:[ERROR][http-nio-8080-exec-20] testUser@lrm.local 2019-07-25 14:47:24,495 com.levatis.lrm.ws.ApplicationRestAPI.postCall(): User testUser12 does not exist.

no body in request

In Request Manager log:

[ WARN][http-nio-8080-exec-16] testUser@lrm.local 2019-07-25 14:48:38,739 org.apache.cxf.phase.PhaseInterceptorChain.unwind(): Exception in handleFault on interceptor org.apache.cxf.jaxrs.interceptor.JAXRSDefaultFaultOutInterceptor@c18e186

 

org.apache.cxf.interceptor.Fault: A JSONObject text must begin with '{' at character 0...

Post Call for Removing Potential Owners Recalculation

Request: POST URL: localhost:8080/jrm/rest/applications/recalculation/remove

{           

    "userId": "testUser",      

    "groupId": ["groupId1","groupId2"],      

    "rolesEx":[            

        {"role":"nexus","request":"Admin"}

        ,

        {"role":"userproxy","request":"Admin"}

    ],

    "recalculate":"true"

}

Parameters

  • role: specific role, which will be assigned to user
  • request: (PU name) request name where the role is specified

Note: If not specified, the default value for recalculate is false.

Get Call for List Users Groups and Roles

Request: GET URL: http://localhost:8080/jrm/rest/applications/recalculation/getRolesAndGroups/Administrator

Excepted Outputs Results for GET Call

200 - OK

{

 "rolesEx":[

  {

   "request":"*",

      "role":"*"

  },

  {

   "request":"emailTest",

   "role":"view"

  },

  {

   "request":"emailTest",

       "role":"createApp"

  },

  {

   "request":"newProcessTestEmail",

   "role":"view"

  },

  {

   "request":"newProcessTestEmail",

   "role":"createApp"

  },

  {

   "request":"newProcessTestEmail",

   "role":"authorise"

  },

  {

   "request":"Admin",

   "role":"lrmconfig"

  },

  {

   "request":"Admin",

   "role":"lrmusermgmnt"

  },

  {

   "request":"Admin",

   "role":"uc4mgmnt"

  },

  {

   "request":"Admin",

   "role":"userproxy"

  }

 ],

 "groupId":[]

}

403 - User has no rights to do the call.

In Request Manager log:

[ERROR][http-nio-8080-exec-16] testUser@lrm.local 2019-07-25 14:43:54,056 com.levatis.lrm.ws.ApplicationRestAPI.permisionCheck(): User testUser@lrm.local has no sufficient rights for this action.

404 - wrong userId in @path parameter in URL

[ERROR][http-nio-8080-exec-20] testUser@lrm.local 2019-07-25 15:01:07,189 com.levatis.lrm.ws.ApplicationRestAPI.getRolesAndGroups(): User Administrator123 does not exist.

401 - The wrong user credentials used for authentication