Summary
This page contains documentation of create shipment REST API. You can use URL: http[s]:<host>:<port>/catissuecoreopenspecimen/rest/ng/shipments url
Use this URL to create a shipment 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 | |
---|---|---|
label | Displays label for name | Name of the shipment. Label must be unique.barcode |
type | BarcodeType of the shipment | . Barcode must be unique.|
specimenListIdentifier | Identifier of specimen list which is shipping. | |
senderSite | Sender site name. | |
receiverSite | Receiver site name. | |
senderContactPerson | Sender's user name | |
receiverContactPerson | Receivers user name | |
sendDate | Date of shipping | |
courierName | Courier name of which shipping sent. | |
courierTrackingId | Courier tracking identifier for a shipment. | |
courierTrackingUrl | Courier Tracking url. | |
activityStatus | Activity status of shipment. Permissible values are {In Progress, Received, Rejected } |
Response :
Response of this event contains details of newly created shipment.
(Optional). Permissible values are {'SPECIMEN', 'CONTAINER'} | |
courierName | Courier name of which shipping sent (Optional). |
trackingNumber | Courier tracking number for a shipment (Optional). |
trackingUrl | Courier tracking URL (Optional). |
sendingSite | Sender site name. |
receivingInstitute | Receiving institute name (Optional). |
receivingSite | Receiver site name. |
notifyUsers | Collection of users to be notified (Optional). |
shippedDate | Date of shipping (Optional). |
senderComments | Sender comments (Optional). |
status | Status of shipment (Optional). Permissible values are {'Pending', 'Shipped'} |
senderComments | Comments from the sender of the shipment (Optional). |
shipmentSpmns | Collection of specimens to be shipped. When the shipment type is 'SPECIMEN'. |
shipmentContainers | Collection of shipments to be shipped. When the shipment type is 'CONTAINER'. |
Example:
#1 Below is an example of creating a 'SPECIMEN' type shipment:
Expand |
---|
...
|
...
|
...
|
...
...
|
#2 Below is an example of creating a 'CONTAINER' type shipment:
Expand | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Error Cases
code | Applies to | Status Message |
---|---|---|
200 | All resources | Shipment The shipment has been created successfully. |
400 | All requests | Invalid parameters, e.g Invalid Users, Invalid Specimen-List id, Null or empty label, barcode. |
401 | All requests | Authorization failed, User doesn’t have Authority. |
500 | All requests | Internal server error, Encountered server error while performing operations. |