Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

openspecimen/rest/ng/departments/{id}

or

openspecimen/rest/ng/departments/name={name}

 

Use this resource to get department. This API returns the department present in the openSpecimen application of given name and id. 

Below are the attributes which need to be sent in the url :

Parameter
Details
idDepartment id to fetch the department
nameDepartment name to fetch the department


http[s]:<host>:<port>/openspecimen/rest/ng/department/{id}

or

http[s]:<host>:<port>/openspecimen/rest/ng/department/name={name}


Use this URL to get department by an id in openSpecimen application.

Result:

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

Below is the example of the get department:

URL

http://<host>:<port>/openspecimen/rest/ng/departments/1

or

http://<host>:<port>/openspecimen/rest/ng/department/name=Department Of Radiology

MethodGET
Requestapplication/json

Response

{

    "id" : "1",

    "name":"Department Of Radiology".

    "instituteName" : "Institute of Oklahoma"

}

 

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