MPET
  1. Listening
MPET
  • HNA-API
    • Operator - Handlings
      • cancelHandling
      • createDetachedHandling
      • createHandling
      • detachHandling
      • getDetachedHandling
      • moveHandling
      • updateDetachedHandling
      • updateHandling
    • Operator - Visits
      • cancelVisit
      • createVisit
      • finalizeLoadDischargeList
      • moveVisit
      • sendLoadDischargeList
      • updateVisit
    • Operator - Voyages
      • cancelVoyage
      • createVoyage
      • getVoyage
      • updateCargoDeclarations
      • updateVoyage
      • updateVoyageRestrictions
    • Listening
      • disconnectClient
        POST
      • listenToShipmentUpdates
        POST
      • listenToUpdate
        POST
      • resetPosition
        POST
      • updatePosition
        POST
  1. Listening

listenToShipmentUpdates

POST
/hna/listen/shipments
Listening
Request Request Example
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
curl --location --request POST '/hna/listen/shipments' \
--header 'Content-Type: application/json' \
--data-raw '{
    "clientId": "string",
    "maxTimeout": 0,
    "maxSize": 0
}'
Response Response Example
{
  "lastIndex": 0,
  "clientSegment": [
    0,
    0
  ],
  "updates": [
    {
      "index": 0,
      "timestamp": "2019-08-24T14:15:22Z",
      "before": {
        "type": "string",
        "voyageId": "string",
        "declarant": {
          "fullName": "string",
          "shortName": "string",
          "emailAddress": "string",
          "address": "string",
          "city": "string",
          "countryUnCode": "string",
          "countryName": "string",
          "zipCode": "string",
          "phoneNumber": "string",
          "faxNumber": "string",
          "contact": "string",
          "customsEORINumber": "string",
          "ean": "string",
          "chamberOfCommerceNumber": "string",
          "scacCode": "string",
          "scacDisplayCode": "string"
        },
        "cancelled": true,
        "modality": "road",
        "cargoDeclarants": [
          {
            "fullName": "string",
            "shortName": "string",
            "emailAddress": "string",
            "address": "string",
            "city": "string",
            "countryUnCode": "string",
            "countryName": "string",
            "zipCode": "string",
            "phoneNumber": "string",
            "faxNumber": "string",
            "contact": "string",
            "customsEORINumber": "string",
            "ean": "string",
            "chamberOfCommerceNumber": "string",
            "scacCode": "string"
          }
        ],
        "voyageData": {
          "inHouseDischargeNumber": "string",
          "inHouseLoadingNumber": "string",
          "eta": "2019-08-24T14:15:22Z",
          "etd": "2019-08-24T14:15:22Z",
          "modality": "string",
          "voyageId": "string",
          "teuOnArrival": 0,
          "reservedTeu": 0,
          "barge": {
            "europeId": "string"
          },
          "additionalCapacity": {
            "teuCapacity": 0,
            "length": 0
          },
          "planningNotBeforeEta": true,
          "entryPoint": {},
          "exitPoint": {},
          "previousVoyageId": "string"
        },
        "visits": [
          {
            "visitId": "string",
            "visitData": {
              "modality": "string",
              "externalReferenceVisit": "string",
              "eta": "string"
            },
            "requestedVisitData": {},
            "plannedVisitData": {},
            "visitCancelled": true,
            "terminal": {},
            "handlings": "2019-09-12T21:34:22Z",
            "loadDischargeListDeclarations": [
              {}
            ],
            "endOfOperations": "2019-09-12T21:34:22Z",
            "loadDischargeListClosed": "2019-08-24T14:15:22Z",
            "loadDischargeListClosing": "2019-08-24T14:15:22Z",
            "visitCompleted": true,
            "loadDischargeListStatus": "open",
            "terminalRemarks": "string",
            "modality": "road",
            "neverAcknowledged": true,
            "arrived": true,
            "visitDeclaration": {
              "acknowledgedByTerminal": true,
              "status": "string",
              "rejectReasons": [
                {
                  "code": "string",
                  "terminalDescription": "string",
                  "parsedReason": "string"
                }
              ]
            }
          }
        ]
      },
      "after": {
        "type": "string",
        "voyageId": "string",
        "declarant": {
          "fullName": "string",
          "shortName": "string",
          "emailAddress": "string",
          "address": "string",
          "city": "string",
          "countryUnCode": "string",
          "countryName": "string",
          "zipCode": "string",
          "phoneNumber": "string",
          "faxNumber": "string",
          "contact": "string",
          "customsEORINumber": "string",
          "ean": "string",
          "chamberOfCommerceNumber": "string",
          "scacCode": "string",
          "scacDisplayCode": "string"
        },
        "cancelled": true,
        "modality": "road",
        "cargoDeclarants": [
          {
            "fullName": "string",
            "shortName": "string",
            "emailAddress": "string",
            "address": "string",
            "city": "string",
            "countryUnCode": "string",
            "countryName": "string",
            "zipCode": "string",
            "phoneNumber": "string",
            "faxNumber": "string",
            "contact": "string",
            "customsEORINumber": "string",
            "ean": "string",
            "chamberOfCommerceNumber": "string",
            "scacCode": "string"
          }
        ],
        "voyageData": {
          "inHouseDischargeNumber": "string",
          "inHouseLoadingNumber": "string",
          "eta": "2019-08-24T14:15:22Z",
          "etd": "2019-08-24T14:15:22Z",
          "modality": "string",
          "voyageId": "string",
          "teuOnArrival": 0,
          "reservedTeu": 0,
          "barge": {
            "europeId": "string"
          },
          "additionalCapacity": {
            "teuCapacity": 0,
            "length": 0
          },
          "planningNotBeforeEta": true,
          "entryPoint": {},
          "exitPoint": {},
          "previousVoyageId": "string"
        },
        "visits": [
          {
            "visitId": "string",
            "visitData": {
              "modality": "string",
              "externalReferenceVisit": "string",
              "eta": "string"
            },
            "requestedVisitData": {},
            "plannedVisitData": {},
            "visitCancelled": true,
            "terminal": {},
            "handlings": "2019-09-12T21:34:22Z",
            "loadDischargeListDeclarations": [
              {}
            ],
            "endOfOperations": "2019-09-12T21:34:22Z",
            "loadDischargeListClosed": "2019-08-24T14:15:22Z",
            "loadDischargeListClosing": "2019-08-24T14:15:22Z",
            "visitCompleted": true,
            "loadDischargeListStatus": "open",
            "terminalRemarks": "string",
            "modality": "road",
            "neverAcknowledged": true,
            "arrived": true,
            "visitDeclaration": {
              "acknowledgedByTerminal": true,
              "status": "string",
              "rejectReasons": [
                {
                  "code": "string",
                  "terminalDescription": "string",
                  "parsedReason": "string"
                }
              ]
            }
          }
        ]
      },
      "type": "string",
      "triggeredByOrganisation": true,
      "triggeredByUser": true,
      "triggeredByRecipient": {}
    }
  ]
}

Request

Body Params application/json
clientId
string 
required
maxTimeout
integer <int64>
optional
maxSize
integer <int32>
optional
Examples

Responses

🟢200default response
application/json
Body
lastIndex
integer <int64> | null 
optional
Returns the index of the last update sent to the client. If the client has successfully processed the updates in this api response, it should send this lastIndex value in its request to /updatePosition. If no request to /updatePosition is made before the next request to /listen the same updates will be received again.
clientSegment
array[integer <int32>] | null 
optional
Returns the segment of messages that is allocated to the client. The start value is inclusive, the end value is exclusive. There are 128 segments. A clientSegment return value of [0,128] means that this client is receiving updates for all the segments. A return value of [64,128] means this client is receiving updates for the segments 64 (inclusive) to 128 (exclusive). Use this value in the request to /updatePosition after the updates have been processed successfully.
>= 2 items<= 2 items
updates
array [oneOf] 
optional
List of individual updates.
object (HnaListenUpdateResponse) 
optional
List of individual updates.
null 
optional
Modified at 9 months ago
Previous
disconnectClient
Next
listenToUpdate
Built with