Skip to content
Documentation sections

Using webhooks as a push API

The Safecube Webhooks API serves two purposes: notifying your users about specific changes in the tracking data, and updating your data automatically without any Container Tracking API request. Used the second way, it is a push container tracking API. The Synchronous and asynchronous tracking page compares both approaches.

Steps of a push integration

Using the Webhooks API as a push API takes five steps:

  1. Set up how you want to receive the data: create an endpoint.
  2. Push the shipment details to the Safecube monitoring system: add shipments to the endpoint.
  3. Receive the initial tracking data of each shipment.
  4. Receive an update whenever Safecube has new data for a shipment.
  5. Optionally, receive an alert when a shipment you pushed cannot be tracked.

The Getting started with webhooks page shows how to create an endpoint and push your first shipments.

Subscribe the endpoint to these events:

NeedEvent
Receive the initial tracking data of a shipmentshipment.added.to.endpoint
Receive an update whenever new data is availableshipment.any.change
Be alerted when a pushed shipment cannot be trackedshipment.in.error and shipment.auto.removed

The Webhook events page describes the trigger and payload of each event.

Targeted events alongside push tracking

Using the Webhooks API as a push API does not prevent more targeted notifications. Subscribing to granular events tells you at once what changed, from the event type itself.

For example, date.changed.vessel.arrival.at.final.pod notifies every change of the estimated time of arrival at the POD, while shipment.any.change keeps you informed of every other update.