π Widget API
Widget APIβ
The widget API answers one-off lookups: send a single reference and get back the shipment that best matches it, with its containers, their latest status, the vessel's track and a link to the shipment in your Dockflow portal. It is the endpoint the Widget Embed uses. Call it yourself to show the same data in your own interface.
GET /api/v2/widget-search with a Web widget key from Settings β Organisation keeps working. It is documented under API v2 βΊ Web-widget API. This page describes the Trident (v3) endpoint, which takes an API Console key with the Widget scope.
Authentication πβ
Create a key with only the Widget scope in the API Console (see Authorization). Send it in the Authorization header. The bare key and the Bearer scheme are both accepted:
Authorization: Bearer prod_acme-logistics_Zk3n1c0Q2m9...
A widget key only ever searches the shipments of your own organisation, and only on this endpoint. Downstream and upstream keys are refused here, and a widget key is refused on every other Trident endpoint.
Requestβ
GET https://api.dockflow.com/v3/widget/search?q=YOUR_REFERENCE
Use https://uat.dockflow.com/v3/widget/search with a uat_β¦ key.
| Parameter | Description |
|---|---|
q | (mandatory) A container number, booking or bill of lading reference, 4 to 64 characters. |
Only the best match is returned, never a list.
Response πβ
| Field | Description |
|---|---|
references | Your own references for the shipment (order, PO, β¦) |
carrier | Carrier name, null when unknown |
booking_reference / bill_of_lading_reference | Carrier references, null when unknown |
departure / arrival | Port of loading and of discharge: vessel_name, event_date, whether that date is actual, and the location |
containers | Each container with its type_code, type_group, length and its latest_actual_milestone |
tracks | Position readings along the route (event_date, lat, lng), one entry per tracking source |
details_url | The shipment in your Dockflow portal, null when nothing matches |
A location has a name, unlocode, timezone, country (name, iso_a2) and a point (lat, lng). point is null when the coordinates are unknown. Dates are ISO 8601. Show them in the location's timezone, not in UTC, or an event can land on the wrong day.
A milestone's status is a readable label for the main events:
| Label | Event |
|---|---|
Gate out empty | Empty container picked up |
Gate in full | Full container delivered at the terminal |
Loaded on vessel | Loaded on board |
Vessel departure | Vessel left the port |
Vessel arrival | Vessel arrived in the port |
Unloaded from vessel | Discharged from the vessel |
Gate out full | Full container picked up at the terminal |
Gate out to inland depot | Moved to an inland depot |
Empty return | Empty container returned |
Other events are returned with their raw Dockflow status code.
details_url points to your organisation's own portal domain when you have one (for example https://yourcompany.dockflow.com/tradeflow/view/β¦), and to app.dockflow.com otherwise. Opening it requires a Dockflow account with access to the shipment.
Exampleβ
{
"references": ["PO-2026-0418"],
"carrier": "MSC",
"booking_reference": "EBKG04821937",
"bill_of_lading_reference": "MEDUAN482193",
"departure": {
"vessel_name": "MSC DEMO",
"event_date": "2026-09-25T11:00:00+00:00",
"actual": true,
"location": {
"name": "Antwerpen",
"unlocode": "BEANR",
"timezone": "Europe/Brussels",
"country": { "name": "Belgium", "iso_a2": "BE" },
"point": { "lat": 51.2637, "lng": 4.3987 }
}
},
"arrival": {
"vessel_name": "MSC DEMO",
"event_date": "2026-10-05T09:00:00+00:00",
"actual": false,
"location": {
"name": "Istanbul",
"unlocode": "TRIST",
"timezone": "Europe/Istanbul",
"country": { "name": "TΓΌrkiye", "iso_a2": "TR" },
"point": { "lat": 40.9667, "lng": 28.8 }
}
},
"containers": [
{
"reference": "DEMU1234565",
"type_code": "45G1",
"type_group": "GP",
"length": "40",
"latest_actual_milestone": {
"status": "Vessel departure",
"event_date": "2026-09-25T11:00:00+00:00",
"vessel_name": "MSC DEMO",
"location": {
"name": "Antwerpen",
"unlocode": "BEANR",
"timezone": "Europe/Brussels",
"country": { "name": "Belgium", "iso_a2": "BE" },
"point": { "lat": 51.2637, "lng": 4.3987 }
}
}
}
],
"tracks": [
{
"device_reference": "AIS MSC DEMO",
"readings": [
{ "event_date": "2026-09-25T12:00:00+00:00", "lat": 51.33, "lng": 4.25 },
{ "event_date": "2026-09-25T18:00:00+00:00", "lat": 51.45, "lng": 3.1 }
]
}
],
"details_url": "https://yourcompany.dockflow.com/tradeflow/view/482193"
}
Nothing foundβ
When no shipment matches, the API still answers HTTP 200, with every field empty:
{
"references": [],
"carrier": null,
"booking_reference": null,
"bill_of_lading_reference": null,
"departure": null,
"arrival": null,
"containers": [],
"tracks": [],
"details_url": null
}
Errorsβ
Error bodies have the shape {"error": "<message>", "status": <code>}. The key errors are listed under Authorization βΊ Authentication errors. Two more are specific to this endpoint:
| Status | Message | Cause |
|---|---|---|
| 403 | Token lacks the "widget" scope. | A downstream or upstream key was used. Create a separate key with only the Widget scope. |
| 422 | {"message": β¦, "errors": {"q": [ β¦ ]}} | q is missing, or shorter than 4 or longer than 64 characters. |
Feedback and Support π§β
Questions or issues? Reach out to our support team at [email protected].