Got feedback or spotted a mistake?

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

Create Department

openspecimen/rest/ng/departments

Use this resource to create new department 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
name Department Name. It should be unique in specified institute
instituteName

Institute name in which the department comes. For this the institute should be already registered in system.


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

Use this URL to add department in openSpecimen application.

Result:

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

Below is the example of the create department:

URLhttp://<host>:<port>/openspecimen/rest/ng/departments
MethodPOST
Requestapplication/json
json{
    "name":"My department",
    "instituteName" : "KS Cancer Center"
}

Response

{

    "id" : "1",

    "name":"My department",

    "instituteName" :  "KS Cancer Center"
}

 

 Error Cases :

code
Applies to
Status Message
200All resourcesDepartment has been created successfully
400All requestsInvalid parameters, e.g  duplicate department name, blank department 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