listenToUpdate
POST
/hna/listenRequest
{
"clientId": "string",
"maxTimeout": 0,
"maxSize": 0
}
Request samples
Responses
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.
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.
List of individual updates.
List of individual updates.
{
"lastIndex": 0,
"clientSegment": [
0,
0
],
"updates": [
{
"index": 0,
"timestamp": "2019-08-24T14:15:22.123Z",
"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:22.123Z",
"etd": "2019-08-24T14:15:22.123Z",
"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:22.123Z",
"loadDischargeListClosing": "2019-08-24T14:15:22.123Z",
"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:22.123Z",
"etd": "2019-08-24T14:15:22.123Z",
"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:22.123Z",
"loadDischargeListClosing": "2019-08-24T14:15:22.123Z",
"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": {}
}
]
}