Versions Compared

Key

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

...

openspecimen/rest/ng/users?start={start}&max={maxResults}&searchString={searchString}&countReq={true/falsename={name}&loginName={loginName}&institute={institute}&activityStatus={activityStatus}&site={siteName}

Use this resource to get users. This API returns all the matching users based on the searchString,  if searchString not specified then it returns all the users 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
start [optional]start index of the results
maxResults [optional]Maximum number of records to fetch. By default it will be 50
searchString [optional]The value with which you want to search the User. The given value will be matched with First Name, Last Name, Login Name, Email Address.
start [optional]start index of the results
maxResults [optional]Maximum number of records to fetch. By default it will be 50
countReq [optional]Set this parameter to true, if want to get the total count of matching results.nameThe value given will be matched with First Name, and Last name of the user
loginNameThe given value will be matched with loginName of the user
instituteResult contains the users which belongs to given institute
activityStatusResult contains the users which have given activityStatus
siteSite name, result contains users which belongs to given institute


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

Use this URL to get users in openSpecimen application.

...

URLhttp://<host>:<port>/openspecimen/rest/ng/users?searchString=Pitersonadmin
MethodGET
Requestapplication/json

Response


Code Block
languagejs
themeEclipse
linenumberstrue
[
{   

    {
        "id":
"1",
   
 1,
        "firstName": "Admin",
        "lastName":
"Piterson",
    "firstName":"Sam",
    "loginName":"samPiterson"

}]

 

...

 "Admin",
        "loginName": "admin@admin.com",
        "domain": null,
        "emailAddress": "admin@admin.com",
        "admin": null,
        "cpCount": 0,
        "creationDate": null
    },
    {
        "id": 100,
        "firstName": "Bocabio",
        "lastName": "Admin",
        "loginName": "Bocabio@admin.com",
        "domain": null,
        "emailAddress": "Bocabio@admin.com",
        "admin": null,
        "cpCount": 0,
        "creationDate": 1437589800000
    }
]



Error Cases :

code
Applies to
Status Message
200All resourcesUsers got successfully
401All requestsAuthorization failed, user doesn’t have authority
500All requestsInternal server error, encountered server error while performing operations

...