Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Expand
titleTable of contents
Table of Contents

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:

  • 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:

  • 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 in section /wiki/spaces/AHID/pages/83005356 here, which supports partial searchmatch.

  • You can always lookup which vehicles are available for allocation by using the vehicle listing endpoint. See /wiki/spaces/AHID/pages/83005356 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

  1. Vehicles from your current network, which comprises

    1. own vehicles and

    2. vehicles shared by your partners (e.g. subcontractors)

  2. Vehicles outside of your current network, which are

    1. 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:

image-20241003-072935.pngImage Added
Info

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

.
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

  1. 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.

  1. 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 value auto_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"
    }

  2. 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 field start_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 DELETE
  1. future vehicles):

    Code Block
    {
        "license_plate_number": "CD 34 EF",
        "start_tracking_at": 2024-09-12T11:35:39.643Z"
    }

  2. 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 fields allocation_switch_type with value auto_switch as well as start_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:

  • 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 delete an allocationdeallocate a vehicle, unless you want the transport to stay unallocateddeallocated(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 on how to “allocate for different options on allocating multiple vehicles to a transport”.An allocation deletion does not remove the history of the vehicle tracking data already received. It stops the vehicle tracking from this point in time.

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.