POST a Vehicle to Transport Allocation
To allocate a vehicle to a transport, you must provide the following URL parameters:
The
identifier_type
that should be used to uniquely identify the transport. The available types are:transport_id
transport_number
--> see /wiki/spaces/AHID/pages/83005102 here for more infos on the definition of those fields.
The
identifier_value
: The actual value of the identifier.
In the payload of the request, the vehicle license plate number of the vehicle that should be allocated is used.
To execute an allocation, make an authenticated POST
request as shown in the example below:
https://api.transporeon.com/rtv/v1/transports/{identifier_type}/{identifier_value}/allocation
Code Block |
---|
{ "license_plate_number": "AB 12 CD" } |
Info |
---|
Please note the following:
|
Allocate a vehicle that is not in your vehicle network
In Transporeon Visibility, you can allocate
Vehicles from your current network, which comprises
own vehicles and
vehicles shared by your partners (e.g. subcontractors)
Vehicles outside of your current network, which are
vehicles of partners which are not yet in your current network
The allocation to a vehicle outside of your current network is done in the same way as it is explained in POST a Vehicle to Transport Allocation section above.
You can notice the difference in the response message, which will be 200 OK (instead of 204 No Content for a regular allocation):
Code Block |
---|
{
message: "Global allocation - limited visibility. Allocated vehicle "12345" is outside of vehicle pool."
} |
Info |
---|
For the definition of standard and limited visibility, have a look here. |
Allocate multiple vehicles to a transport
Info |
---|
Note before your read on: Allocating multiple vehicles to a transport is only needed when the tractor (= the pulling unit) is the part being tracked. If the trailer is tracked, it’s anyway usually going from the very first to the very last location and therefore no “tractor switch” is needed. |
It is possible that multiple tracked vehicles are involved to execute a given transport.
This usually happens when a tractor of a truck (ie. the pulling unit) takes the trailer (where the goods are in) from a loading location A to an intermediate hub location B stop to a switch location (cross-dock, warehouse, etc.), where another tractor hooks up the trailer and delivers it to the unloading location C.In short: Loading (A) → Intermediate (B) → Unloading (C), where tractor 1 does A to B and tractor 2 does B to C (by pulling the trailer respectively)stop:
Info |
---|
There is no limitation to how many vehicles can be involved in a transport. The order of allocations defines the order of switches. |
Info |
---|
There is no limitation to how many vehicles can be involved in a transport. |
The following ways of allocating multiple vehicles to a transport are supported:
Real-time allocation, where the focus is on when a future vehicle should be taken into account for tracking
Immediately: When you allocate “tractor 2” “Tractor A” on top of (the already existing allocation) “tractor 1”“Tractor B”, Visibility switches to the tracking stream of “tractor 2” “Tractor B” at the time the request is received (“in real-time”). Also called “Real-time allocation”.
This requires the carrier to know when to send the request in order to switch tractors.In order to do so, just send another POST allocation request as shown below:
First:
Code Block { "license_plate_number": "AB 12 CD" }
And then:
Code Block { "license_plate_number": "CD 34 EF" }
Info |
---|
In the example above, the ideal point in time to switch is when tractor 1 Tractor A already dropped the trailer at intermediate switch location and Tractor B and tractor 2 started driving towards this location. |
Auto-switch allocationdetect: You can plan the vehicles involved in a transport upfront. In that case, Visibility Hub will automatically detect when and where to switch from one tractor to the next one.
It’s done when a vehicle break is detected both vehicles have stopped in the same location for both vehicles, time independent (“based on auto-switch”).
Example: Tractor A brings the trailer to a switch location and leaves again. Later, Tractor B arrives at the switch location and hooks the trailer. The stop in the same location is detected automatically and the tracking stream is switched to Tractor B.In order to send such an allocation request, you need to include the optional field
allocation_switch_type
with valueauto_switch
for the vehicle to be switched to as shown below:First:
Code Block { "license_plate_number": "AB 12 CD" }
And then (and repeat that step of all future vehicles):
Code Block { "license_plate_number": "CD 34 EF", "allocation_switch_type": "auto_switch" }
Manual: You can plan the vehicles involved in a transport upfront. In this case, you supply a timestamp when Visibility Hub should switch from one tractor to the next one.
In order to send such an allocation request, you need to include the optional fieldstart_tracking_at
with the timestamp value in addition to the license plate:
First:Code Block { "license_plate_number": "AB 12 CD" }
Repeat And then (and repeat that step until of all vehicles involved are allocated. The order of allocations defines the order of switches.
DELETE an Allocation
To delete an allocation, make an authenticated DELETEfuture vehicles):
Code Block { "license_plate_number": "CD 34 EF", "start_tracking_at": 2024-09-12T11:35:39.643Z" }
Combined: Auto-detect and Manual options can be combined. It follows the rules of auto-detect, but uses the manually added timestamp as a fallback in case the auto-detect didn’t work as expected, because for example GPS updates were missing or too infrequent.
In order to send such an allocation request, you need to include the fieldsallocation_switch_type
with valueauto_switch
as well asstart_tracking_at
with the timestamp indicated the latest time for the vehicle to be switched to as shown below:
First:Code Block { "license_plate_number": "AB 12 CD" }
And then (and repeat that step of all future vehicles):
Code Block { "license_plate_number": "CD 34 EF", "allocation_switch_type": "auto_switch", "start_tracking_at": 2024-09-12T11:35:39.643Z" }
POST a vehicle deallocation
To remove the latest allocation from a transport, make an authenticated POST
request as shown in the example below, the transport status will be then unallocated:
POST https://api.transporeon.com/rtv/v1/transports/{identifier_type}/{identifier_value}/
allocationdeallocation
Info |
---|
Note that:
|
DELETE all allocations & tracking history
If you want to remove all vehicle allocations and delete tracking data already received from those vehicles on a given transport, you can revert this transport to it’s state before any allocations were received.
To do so, make an authenticated DELETE
request as shown in the example below:
DELETE https://api.transporeon.com/rtv/v1/transports/{identifier_type}/{identifier_value}/allocation
Info |
---|
Note: If you want to replace a vehicle allocation before the transport starts, it is safer to first DELETE all previously made allocations and POST the new allocation(s) to avoid unexpected side effects, as the internal tracking of a vehicle starts before the vehicle reaches it’s first stop. |
GET the Vehicle Allocated to a Transport
To receive the latest allocated vehicle that is actively tracked at the momentfor the given transport, make an authenticated GET request as shown in the example below:
https://api.transporeon.com/rtv/v1/transports/{identifier_type}/{identifier_value}/allocation
The response contains the vehicle license plate number as well as the datetime when the allocation was created:
Code Block |
---|
{ "transport_allocation": { "created_at": "2022-12-15T02:03:47.179Z", "license_plate_number": "UL-RTV 24163" } } |
Info |
---|
If multiple vehicles were allocated to a transport, this endpoint retrieves the latest vehicle allocation. It is currently not possible to retrieve all previously made vehicle allocations. |