Got feedback or spotted a mistake?

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

Get All Departments

openspecimen/rest/ng/departments

or

openspecimen/rest/ng/departments?maxResults={maxResults}

Use this resource to get all departments. This API returns all the departments present in the openSpecimen application. Use HTTP GET 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
maxResultsMaximum number of records to fetch. By default it will be 1000


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

or

http[s]:<host>:<port>/openspecimen/rest/ng/departments?maxResults={maxResults}


Use this URL to get departments in openSpecimen application.

Result:

The response of this request will contains the details of the departments.

Below is the example of the get departments:

URLhttp://<host>:<port>/openspecimen/rest/ng/departments
MethodGET
Requestapplication/json

Response

[{

    "id" : "1",

    "name":"Department Of Radiology",

    "instituteName" : "Institute of Oklahoma"

},{

    "id" : "2",

    "name":"Department Of Radiology",

    "instituteName" : "AKU HBRC",

}]

 

 

Error Cases :

code
Applies to
Status Message
200All resourcesDepartment got successfully
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