Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Create Role

openspecimen/rest/ng/roles

Use this resource to create new role in the openSpecimen application. Use HTTP POST method to call this API by passing the below details in JSON format.

 

Below are the attributes which need to be sent in the request body:

Parameter
Details
nameRole Name. It should be unique in application
privilegeNames

Privilege names that comes under the role, permissible values are

{ User Provisioning, Storage Administration, Protocol Administration, Specimen Processing, Registration, Distribution, Read Denied }

description[optional]Description for role, By default it will be null


http[s]:<host>:<port>/openspecimen/rest/ng/roles

Use this URL to add role in openSpecimen application.

Result:

The response of this request will contains the details of the created role.

Below is the example of the create role:

URLhttp://<host>:<port>/openspecimen/rest/ng/roles
MethodPOST
Requestapplication/json
json{
    "name":"Scientiest",
    "privilegeNames" : ["User Provisioning", "Registration"]
}

Response

{

    "id" : "1",

    "name":"Scientiest",

    "privilegeNames" : ["User Provisioning", "Registration"] 
}

 

 Error Cases :

code
Applies to
Status Message
200All resourcesRole has been created successfully
400All requestsInvalid parameters, e.g  duplicate role name, blank role name etc
401All requestsAuthorization failed, user doesn’t have authority
500All requestsInternal server error, encountered server error while performing operations

 


   

Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com