Got feedback or spotted a mistake?

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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Use the following resource to create new specimen list in the OpenSpecimen application. Use HTTP POST method to call this API by passing the below details in JSON format.

Resource:

catissuecore/rest/ng/users

 

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

ParameterDetails
labelA display name for Specimen-list.
sharedWithCollection of Users with whom the list is shared with. This member is optional.
id(sharedWith) User id of the person with whom the list is shared with.
specimensCollection of specimens which belong to the given list. A Specimen-list can have one or more specimens in it. This member is optional.
id

(specimens) Identifier of the specimen.

 

http[s]:<host>:<port>/catissuecore/rest/ng/specimen-lists

Use this URL to add a new Specimen-list in OpenSpecimen.

 

Result:

The response of this request will contain the details of the newly created specimen-list.

Please find request, response details below.

 

URLhttp://<host>:<port>/catissuecore/rest/ng/specimen-lists
MethodPOST
Content-Typeapplication/json
Request

{

     "label":"Brain Cancer CP - C123 - S1",

     "sharedWith":[{"id":2},{"id":3}],

     "specimens":[{"id":12},{"id":13}]

}

Response{
       "status": "OK",
       "message": null,
       "exception": null,
       "erroneousFields": null,
       "specimenListDetails":
       {
           "id": 49,
           "label": "Brain Cancer CP - C123 - S1",
           "owner":
           {
               "id": 1,
               "firstName": "current-user",
               "lastName": "current-user",
               "loginName": "currentuser@example.com"
           },
           "sharedWith":
           [
               {
                   "id": 3,
                   "firstName": "tech",
                   "lastName": "tech",
                   "loginName": "tech@tech.com"
               },
               {
                   "id": 2,
                   "firstName": "super",
                   "lastName": "super",
                   "loginName": "super@super.com"
               }
           ],
           "specimens":
           [
               {
                   "id": 12,
                   "label": "2"
               },
               {
                   "id": 13,
                   "label": "3"
               }
           ]
       }
    }

code
Applies to
Status Message
200All resourcesSpecimen-list has been created successfully.
400All requestsInvalid parameters, e.g  duplicate Specimen-list label, Invalid User-ids, Invalid Specimen-ids.
401All requestsAuthorization failed, User doesn’t have Authority.
500All requestsInternal server error, Encountered server error while performing operations.
  • No labels