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 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
{ "license_plate_number": "AB 12 CD" }
Please note the following:
The license plate number provided in the allocation message needs to match the license plate number from the vehicle connected to Transporeon.
The input is normalized to alphanumeric characters. Example:
If there is an input "AB-12.CD" and a vehicle "AB 12 CD" is available in your connected vehicles list in Visibility Hub, it will match and succeed.
If there is an input "AB-12.CD" and a vehicle "AB-12.CD Harry" (or "AB 12 CD/BB 77 FD") is available in your connected vehicles list in Visibility Hub, it will not match. You need to first lookup the correct vehicle license plate using the
/vehicles
endpoint described here, which supports partial match.
You can always lookup which vehicles are available for allocation by using the vehicle listing endpoint. See here for more details.
The response will be empty, showing http code
204 No Content
in case of success.In case there is any problem, refer to the error message given in the response.
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):
{ message: "Global allocation - limited visibility. Allocated vehicle "12345" is outside of vehicle pool." }
For the definition of standard and limited visibility, have a look here.
Allocate multiple vehicles to a transport
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 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 takes the trailer from a loading stop to a switch location (cross-dock, warehouse, etc.), where another tractor hooks up the trailer and delivers it to the unloading stop:
There is no limitation to how many vehicles can be involved in a transport. The order of allocations defines the order of switches.
There can be an arbitrary number of intermediate stops and any combination of loading/unloading stops. The example above will be used to explain the behavior below.
The following ways of allocating multiple vehicles to a transport are supported, where the focus is on when a future vehicle should be taken into account for tracking
Immediately: When you allocate “Tractor A” on top of (the already existing allocation) “Tractor B”, Visibility switches to “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:
{ "license_plate_number": "AB 12 CD" }
And then:
{ "license_plate_number": "CD 34 EF" }
In the example above, the ideal point in time to switch is when Tractor A already dropped the trailer at switch location and Tractor B started driving towards this location.
Auto-detect: 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 both vehicles have stopped in the same location, 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 field
allocation_switch_type
with valueauto_switch
for the vehicle to be switched to as shown below:First:
{ "license_plate_number": "AB 12 CD" }
And then (and repeat that step of all future vehicles):
{ "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:{ "license_plate_number": "AB 12 CD" }
And then (and repeat that step of all future vehicles):
{ "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:{ "license_plate_number": "AB 12 CD" }
And then (and repeat that step of all future vehicles):
{ "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:
POST https://api.transporeon.com/rtv/v1/transports/{identifier_type}/{identifier_value}/deallocation
Note that:
A deallocation does not remove the history of the vehicle tracking data already received. It stops the vehicle tracking from this point in time.
If you want to delete all vehicle allocations and by that remove the tracking history of a given transport, use the DELETE endpoint as described below.
It's not needed to deallocate a vehicle, unless you want the transport to stay deallocated (for example to stop tracking the current vehicle) or you allocated the wrong license plate accidentally.
If multiple vehicles are involved in the transport execution, you can just allocate on top of the existing allocation, and from this point in time, the new vehicle will be tracked (keeping the data from the previous vehicle) - see section above for different options on allocating multiple vehicles.
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
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 for 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:
{ "transport_allocation": { "created_at": "2022-12-15T02:03:47.179Z", "license_plate_number": "UL-RTV 24163" } }
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.