diff --git a/API.html b/API.html index e07a1f5c3..248bebf48 100644 --- a/API.html +++ b/API.html @@ -12,358 +12,382 @@ margin: 0; } - -

DDD Sample API (1.0.0)

Download OpenAPI specification:Download

API for cargo tracking, booking, routing and handling in the DDD Sample application

-

REST - Cargo Tracking

DDD Sample API (1.0.0)

Download OpenAPI specification:

API for cargo tracking, booking, routing and handling in the DDD Sample application

+

REST - Cargo Tracking

REST endpoints for tracking cargo status programmatically

-

Track cargo (REST API)

Get tracking information for a cargo via REST API

-
path Parameters
trackingId
required
string

The tracking ID of the cargo to track

-

Responses

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "statusText": "In transit",
  • "destination": "USNYC",
  • "eta": "2024-01-15T14:00:00Z",
  • "nextExpectedActivity": "Unload in Rotterdam",
  • "misdirected": false,
  • "events": [
    ]
}

REST - Handling Reports

Track cargo (REST API)

Get tracking information for a cargo via REST API

+
path Parameters
trackingId
required
string

The tracking ID of the cargo to track

+

Responses

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "statusText": "In transit",
  • "destination": "USNYC",
  • "eta": "2024-01-15T14:00:00Z",
  • "nextExpectedActivity": "Unload in Rotterdam",
  • "misdirected": false,
  • "events": [
    ]
}

REST - Handling Reports

REST endpoints for submitting cargo handling events

-

Submit handling report

Submit a report for cargo handling events

-
Request Body schema: application/json
required
completionTime
required
string <date-time>

When the handling was completed

-
trackingIds
required
Array of strings (TrackingId)

The tracking IDs of the cargos

-
type
required
string (HandlingEventType)
Enum: "LOAD" "UNLOAD" "RECEIVE" "CLAIM" "CUSTOMS"

Type of handling event

-
unLocode
required
string (UnLocode)

UN/LOCODE of a location

-
voyageNumber
string (VoyageNumber)

Unique identifier of a voyage

-

Responses

Request samples

Content type
application/json
{
  • "completionTime": "2024-01-01T10:00:00Z",
  • "trackingIds": [
    ],
  • "type": "LOAD",
  • "unLocode": "USNYC",
  • "voyageNumber": "V001"
}

REST - Cargo Administration

Submit handling report

Submit a report for cargo handling events

+
Request Body schema: application/json
required
completionTime
required
string <date-time>

When the handling was completed

+
trackingIds
required
Array of strings (TrackingId)

The tracking IDs of the cargos

+
type
required
string (HandlingEventType)
Enum: "LOAD" "UNLOAD" "RECEIVE" "CLAIM" "CUSTOMS"

Type of handling event

+
unLocode
required
string (UnLocode)

UN/LOCODE of a location

+
voyageNumber
string (VoyageNumber)

Unique identifier of a voyage

+

Responses

Request samples

Content type
application/json
{
  • "completionTime": "2024-01-01T10:00:00Z",
  • "trackingIds": [
    ],
  • "type": "LOAD",
  • "unLocode": "USNYC",
  • "voyageNumber": "V001"
}

REST - Cargo Administration

REST endpoints for managing cargo bookings and routing

-

List available locations

Returns the list of all available shipping locations

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List all cargos

Returns a list of all registered cargos

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Register new cargo

Books a new cargo with specified origin, destination and arrival deadline

-
Request Body schema: application/json
required
originUnlocode
required
string (UnLocode)

UN/LOCODE of a location

-
destinationUnlocode
required
string (UnLocode)

UN/LOCODE of a location

-
arrivalDeadline
required
string <date-time>

Deadline for cargo arrival

-

Responses

Request samples

Content type
application/json
{
  • "originUnlocode": "USNYC",
  • "destinationUnlocode": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z"
}

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Get cargo details

Returns detailed information about a specific cargo

-
path Parameters
trackingId
required
string (TrackingId)
Example: ABC123

Unique identifier for tracking the cargo

-

Responses

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Get route candidates

Returns possible routing options for a specific cargo

-
path Parameters
trackingId
required
string (TrackingId)
Example: ABC123

Unique identifier for tracking the cargo

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Assign route to cargo

Assigns a selected route to a cargo

-
path Parameters
trackingId
required
string (TrackingId)
Example: ABC123

Unique identifier for tracking the cargo

-
Request Body schema: application/json
required
Array
voyageNumber
string (VoyageNumber)

Unique identifier of a voyage

-
from
string (UnLocode)

UN/LOCODE of a location

-
to
string (UnLocode)

UN/LOCODE of a location

-
loadTime
string <date-time>

When the cargo is scheduled to be loaded onto the carrier

-
unloadTime
string <date-time>

When the cargo is scheduled to be unloaded from the carrier

-

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Change cargo destination

Updates the destination of a cargo

-
path Parameters
trackingId
required
string (TrackingId)
Example: ABC123

Unique identifier for tracking the cargo

-
Request Body schema: application/json
required
unLocode
required
string (UnLocode)

UN/LOCODE of a location

-

Responses

Request samples

Content type
application/json
{
  • "unLocode": "USNYC"
}

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Web - Cargo Administration

List available locations

Returns the list of all available shipping locations

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List all cargos

Returns a list of all registered cargos

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Register new cargo

Books a new cargo with specified origin, destination and arrival deadline

+
Request Body schema: application/json
required
originUnlocode
required
string (UnLocode)

UN/LOCODE of a location

+
destinationUnlocode
required
string (UnLocode)

UN/LOCODE of a location

+
arrivalDeadline
required
string <date-time>

Deadline for cargo arrival

+

Responses

Request samples

Content type
application/json
{
  • "originUnlocode": "USNYC",
  • "destinationUnlocode": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z"
}

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Get cargo details

Returns detailed information about a specific cargo

+
path Parameters
trackingId
required
string (TrackingId)
Example: ABC123

Unique identifier for tracking the cargo

+

Responses

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Get route candidates

Returns possible routing options for a specific cargo

+
path Parameters
trackingId
required
string (TrackingId)
Example: ABC123

Unique identifier for tracking the cargo

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Assign route to cargo

Assigns a selected route to a cargo

+
path Parameters
trackingId
required
string (TrackingId)
Example: ABC123

Unique identifier for tracking the cargo

+
Request Body schema: application/json
required
Array
voyageNumber
string (VoyageNumber)

Unique identifier of a voyage

+
from
string (UnLocode)

UN/LOCODE of a location

+
to
string (UnLocode)

UN/LOCODE of a location

+
loadTime
string <date-time>

When the cargo is scheduled to be loaded onto the carrier

+
unloadTime
string <date-time>

When the cargo is scheduled to be unloaded from the carrier

+

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Change cargo destination

Updates the destination of a cargo

+
path Parameters
trackingId
required
string (TrackingId)
Example: ABC123

Unique identifier for tracking the cargo

+
Request Body schema: application/json
required
unLocode
required
string (UnLocode)

UN/LOCODE of a location

+

Responses

Request samples

Content type
application/json
{
  • "unLocode": "USNYC"
}

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Web - Cargo Administration

Web endpoints for managing cargo bookings and routing

-

Get cargo registration form data

Returns the list of shipping locations for cargo registration

-

Responses

Response samples

Content type
application/json
{
  • "unlocodes": [
    ],
  • "locations": [
    ]
}

Register new cargo

Books a new cargo with specified origin, destination and arrival deadline

-
Request Body schema: application/x-www-form-urlencoded
required
originUnlocode
required
string

UN/LOCODE of the origin location

-
destinationUnlocode
required
string

UN/LOCODE of the destination location

-
arrivalDeadline
required
string <date>

Deadline for cargo arrival (format dd/MM/yyyy)

-

Responses

List all cargos

Returns a list of all registered cargos

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get cargo details

Returns detailed information about a specific cargo

-
query Parameters
trackingId
required
string

Tracking ID of the cargo

-

Responses

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Get route candidates for cargo

Returns possible routing options for a specific cargo

-
query Parameters
trackingId
required
string

Tracking ID of the cargo

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Assign itinerary to cargo

Assigns a selected route to a cargo

-
Request Body schema: application/x-www-form-urlencoded
required
trackingId
required
string
required
Array of objects

Responses

Get available destinations for cargo

Returns possible new destinations for changing a cargo's route

-
query Parameters
trackingId
required
string

Tracking ID of the cargo

-

Responses

Response samples

Content type
application/json
{
  • "cargo": {
    },
  • "locations": [
    ]
}

Change cargo destination

Updates the destination of a cargo

-
Request Body schema: application/x-www-form-urlencoded
required
trackingId
required
string
unLocode
required
string

Responses

Web - Cargo Tracking

Get cargo registration form data

Returns the list of shipping locations for cargo registration

+

Responses

Response samples

Content type
application/json
{
  • "unlocodes": [
    ],
  • "locations": [
    ]
}

Register new cargo

Books a new cargo with specified origin, destination and arrival deadline

+
Request Body schema: application/x-www-form-urlencoded
required
originUnlocode
required
string

UN/LOCODE of the origin location

+
destinationUnlocode
required
string

UN/LOCODE of the destination location

+
arrivalDeadline
required
string <date>

Deadline for cargo arrival (format dd/MM/yyyy)

+

Responses

List all cargos

Returns a list of all registered cargos

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get cargo details

Returns detailed information about a specific cargo

+
query Parameters
trackingId
required
string

Tracking ID of the cargo

+

Responses

Response samples

Content type
application/json
{
  • "trackingId": "ABC123",
  • "origin": "USNYC",
  • "finalDestination": "USNYC",
  • "arrivalDeadline": "2024-12-24T12:00:00Z",
  • "misrouted": false,
  • "routed": true,
  • "legs": [
    ]
}

Get route candidates for cargo

Returns possible routing options for a specific cargo

+
query Parameters
trackingId
required
string

Tracking ID of the cargo

+

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Assign itinerary to cargo

Assigns a selected route to a cargo

+
Request Body schema: application/x-www-form-urlencoded
required
trackingId
required
string
required
Array of objects

Responses

Get available destinations for cargo

Returns possible new destinations for changing a cargo's route

+
query Parameters
trackingId
required
string

Tracking ID of the cargo

+

Responses

Response samples

Content type
application/json
{
  • "cargo": {
    },
  • "locations": [
    ]
}

Change cargo destination

Updates the destination of a cargo

+
Request Body schema: application/x-www-form-urlencoded
required
trackingId
required
string
unLocode
required
string

Responses

Web - Cargo Tracking

Web endpoints for tracking cargo status through the UI

-

Get cargo tracking form

Returns the form for tracking cargo

-

Responses

Track cargo

Track a cargo by its tracking ID

-
Request Body schema: application/x-www-form-urlencoded
required
trackingId
required
string

The tracking ID of the cargo to track

-

Responses

+

Get cargo tracking form

Returns the form for tracking cargo

+

Responses

Track cargo

Track a cargo by its tracking ID

+
Request Body schema: application/x-www-form-urlencoded
required
trackingId
required
string

The tracking ID of the cargo to track

+

Responses