...
For version 2, a new subscription is created for every unique combination of:
PortCode
, Category
and FacilityCode
.
Callbacks can be sent as emails to multiple email addresses, or as HTTP requests. When creating the subscription you must pass either WebhookURI and WebhookToken or an EmailAddressList.
...
Version 1 allows a single container visit event type code per request, Version 2 supports multiple container visit event type codes in a single request. Version 2 also supports the use of “ALL” to subscribe to all events for one or more containers.
Event Types are applied to all containers associated to the subscription
V2 Subscriptions are created based on PortCode, Category and Facility Code. POSTs are an Add action rather than a Replace action and any event types included will be applied to all containers currently linked to the subscription i.e. if you send two subscription POSTs with the same Port/Category/Facility but with different containers and different event types then the event types from both POSTs will be linked to the subscription and all containers associated with the subscription will receive event callbacks for the full list of event types associated with the booking.
If you want to reduce the number of event types associated with a Subscription then there are two ways to do this:
Delete the whole subscription and re-add all containers.
Delete all individual containers from the subscription and re-add them.
If containers are subscribed using the same User Defined Refence then any previously sent events should not be resent.
Endpoint
Code Block |
---|
POST https://api.portconnect.io/v2/subscriptions |
...
Code Block | ||
---|---|---|
| ||
{ "subscriptionId": 32, "bookings": [ { "expirationDatetime": "2023-06-20T14:50:30.3+12:00", "bookingNumber": "LOPReferenc1", "userDefinedReference": "User ref 12" } ] } |
...