Versions Compared

Key

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

...

...

...

...

This page contains documentation of update shipment REST API.You can use URL: http[s]:<host>:<port>/catissuecoreopenspecimen/rest/ng/shipments/{label}  url id}

Use this URL to update a shipment in the OpenSpecimen application. Request DetailsUse HTTP PUT 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:

Displays label for

Parameter

Details

label

name

Name of the shipment.

Label must be unique.

barcode

type

Barcode

Type of the shipment

. Barcode must be unique.specimenListIdentifierIdentifier of specimen list which is shipping.senderSiteSender site name.receiverSiteReceiver site name.senderContactPersonSender's user namereceiverContactPersonReceivers user namesendDateDate of shippingcourierNameCourier name of which shipping sent.courierTrackingIdCourier tracking identifier for a shipment.courierTrackingUrlCourier Tracking url.activityStatusActivity status

(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. Permissible values are {

In Progress, Received, Rejected }

Response :

Response of this event contains details of updated shipment.

Example :

URLhttp

'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:

Below is an example of updating a shipment:

Expand
titleUpdating a shipment...

URL

http[s]://<host>:<port>/

...

openspecimen/rest/ng/shipments/{

...

id}

Method

PUT

Content-Type

application/

...

JSON

Request

...

{
"label" : "Brain Cancer Specimen Lists",
"barcode" : "11111",
"specimenListIdentifier" :1,
"senderSite" : "Site A",
"receiverSite" : "Site B",
"senderContactPerson" : "siteA.admin@admin.com",
"receiverContactPerson" : "siteB.admin@admin.com"
"senderComments" : "comments",
"sendDate" : "2014-01-01",
"courierName" : "xyz",
"courierTrackingId" : "CT123",
"courierTrackingUrl" : "xyz.com"
}

...

Code Block
languagejson
{
  "name":"Testing_Shipment_#14",
  "type":"SPECIMEN",
  "courierName":"FedEx",
  "trackingNumber":"FedEx#14",
  "trackingUrl":null,
  "sendingSite":"Pune Site",
  "receivingInstitute":"USB",
  "receivingSite":"Applied Research",
  "shippedDate":1591697659000,
  "status":"Pending",
  "sender":{
    "emailAddress":"admin@localhost"
  },
  "senderComments":"Handle with care. (Edit#2: Added more Specimen)",
  "activityStatus":"Active",
  "shipmentSpmns":[
    {
      "specimen":{
        "label":"TCP_TBS_4.D1.A14"
      }
    },
    {
      "specimen":{
        "label":"TCP_TBS_4.D1.A15"
      }
    }
  ],
  "shipmentContainers":[],
  "notifyUsers":[
    {
      "emailAddress":"admin@localhost"
    }
  ]
}

Response

Code Block
languagejson
{
  "id": 15,
  "name": "Testing_Shipment_#14",
  "type": "SPECIMEN",
  "courierName": "FedEx",
  "trackingNumber": "FedEx#14",
  "trackingUrl": null,
  "sendingSite": "Pune Site",
  "receivingInstitute": "USB",
  "receivingSite": "Applied Research",
  "shippedDate": 1591697659000,
  "sender": {
    "id": 2,
    "type": "SUPER",
    "firstName": "System",
    "lastName": "Administrator",
    "loginName": "admin",
    "domain": "openspecimen",
    "emailAddress": "admin@localhost",
    "instituteName": "USB",
    "primarySite": "Site BO 1",
    "admin": true,
    "instituteAdmin": false,
    "manageForms": true,
    "cpCount": 0,
    "creationDate": null,
    "activityStatus": "Active"
  },
  "senderComments": "Handle with care. (Edit#2: Added more Specimen)",
  "receivedDate": null,
  "receiver": null,
  "receiverComments": null,
  "status": "Pending",
  "activityStatus": "Active",
  "shipmentSpmns": [],
  "shipmentContainers": [],
  "notifyUsers": [
    {
      "id": 2,
      "type": "SUPER",
      "firstName": "System",
      "lastName": "Administrator",
      "loginName": "admin",
      "domain": "openspecimen",
      "emailAddress": "admin@localhost",
      "instituteName": "USB",
      "primarySite": "Site BO 1",
      "admin": true,
      "instituteAdmin": false,
      "manageForms": true,
      "cpCount": 0,
      "creationDate": null,
      "activityStatus": "Active"
    }
  ],
  "specimensCount": null,
  "request": null,
  "shipmentSpecimen": null,
  "shipmentContainer": null,
  "sendMail": true,
  "mergeKey": "Testing_Shipment_#14"
}

Error Cases

code

Applies to

Status Message

200

All resources

The Shipment has been

...

updated 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.