The Event Subscription API works on a per container basis. Requests to create a subscription for a container must include a valid booking or a bill of lading that is associated with the container. Requests must also include a callback URL where future events will be sent. Subscriptions will automatically expire a few days after the container leaves the terminal.
Once a subscription is created, users can request all past events for the container or delete the subscription. When new events for subscribed containers occur, the event data will be pushed to the callback URL provided when the subscription was created.
This API offers the same data as the Container Event History API, but with a specification that resembles the DCSA Track & Trace Standard.
Endpoints
GET /event-subscriptions/:id
GET /event-subscriptions/:id/events
DELETE /event-subscriptions/:id
GET /event-subscriptions
Supported Event Types
Container Position
Container Availability
Rail
Truck
Vessel
Barge
The subscription object
Attributes
subscriptionID string($uuid)
callbackUrl string($uri)
bookingReference string
transportDocumentID string
transportDocumentType string
equipmentReference string
The subscription object
{
"subscriptionID": "123e4567-e89b-12d3-a456-426614174000",
"callbackUrl": "https://myserver.com/send/callback/here",
"bookingReference": "ABC709951",
"transportDocumentID": "ABCD421911263977",
"transportDocumentType": "BOL",
"equipmentReference": "APZU4812090"
}
The event object
The event object models are based on the TradeLens Event Publish API. Refer to their documentation for detailed model attributes.
Please note that TradeLens specifies the event type in the POST URL and not in the model attributes. The callback URL provided in the subscription request will be used as the base URL for these TradeLens endpoints. For a subscription created with the callback URL https://myserver.com/send/callback/here an Actual Gate Out event will be posted to https://myserver.com/send/callback/here/api/v1/transportEvents/actualGateOut.
Create a subscription
Requests to create a subscription for a container must include a valid booking or a bill of lading that is associated with the container.
Parameters
callbackUrl
bookingReference
transportDocumentID
is NULL
.transportDocumentID
bookingReference
is NULL
.transportDocumentType
transportDocumentID
is set. Only the value BOL
is currently supported.equipmentReference
Returns
Status 201
The subscription object.
POST /event-subscriptions
RESPONSE
{
"subscriptionID": "123e4567-e89b-12d3-a456-426614174000",
"callbackUrl": "https://myserver.com/send/callback/here",
"bookingReference": "null",
"transportDocumentID": "ABCD421911263977",
"transportDocumentType": "BOL",
"equipmentReference": "APZU4812090"
}
Retrieve a subscription
Retrieves the details of an existing subscription.
Parameters
No Parameters
Returns
Status 200
The subscription object.
GET /event-subscriptions/:id
RESPONSE
{
"subscriptionID": "123e4567-e89b-12d3-a456-426614174000",
"callbackUrl": "https://myserver.com/send/callback/here",
"bookingReference": "null",
"transportDocumentID": "ABCD421911263977",
"transportDocumentType": "BOL",
"equipmentReference": "APZU4812090"
}
Retrieve past events
List all past events for a subscription. The event object models are based on the TradeLens Event Publish API. Refer to their documentation for detailed model attributes. These object models have no attribute for the event type, so this endpoint returns a wrapper object that includes the event type.
Parameters
No Parameters
Returns
Status 200
List of event object wrappers.
Attributes
eventType string
eventData object($event)
GET /event-subscriptions/:id/events
RESPONSE
[
{
"eventType": "actualGateIn",
"eventData": {
"originatorName": "A Container Moving Enterprise",
"originatorId": "ACME",
"eventSubmissionTime8601": "2018-03-10T11:30:00.000-05:00",
"transportEquipmentId": "d6ab2fe6-8331-623s-2173-kjshf76ehd",
"transportEquipmentRef": null,
"equipmentNumber": null,
"carrierBookingNumber": null,
"billOfLadingNumber": null,
"eventOccurrenceTime8601": "2018-03-13T11:30:00.000-05:00",
"transportationPhase": "Import",
"location": {
"unlocode": "NLRTM"
},
"vehicleId": "VEH625-259",
"vehicleName": "Vehicle Name",
"fullStatus": "Full",
"terminal": null
}
}
]
Delete a subscription
Deletes the subscription. Events for this container will no longer be pushed to the callback URL.
Parameters
No Parameters
Returns
Status 204
DELETE /event-subscriptions/:id
RESPONSE
List all subscriptions
List all active subscriptions.
Parameters
No Parameters
Returns
Status 200
List of subscription objects.
GET /event-subscriptions
RESPONSE
[
{
"subscriptionID": "123e4567-e89b-12d3-a456-426614174000",
"callbackUrl": "https://myserver.com/send/callback/here",
"bookingReference": null,
"transportDocumentID": "ABCD421911263977",
"transportDocumentType": "BOL",
"equipmentReference": "APZU4812090"
}
]