Skip to main content

Transition Fleet Task Instant

POST 

/fleet-task-instant/:id/transition

Transition the Fleet Task Instant to other status

Transitioning Fleet Task Instant To DRAFT Status

DRAFT status meaning that the fleet task instant is not yet ready to be scheduled or started.

  1. Create a fleet task instant
  2. Send a POST request to the /fleet_task_instant/{id}/transition endpoint with the following body:
{
"status": "DRAFT"
}
  1. The fleet task instant will be transitioned to DRAFT status.
  2. You cannot transition a fleet task instant to DRAFT when:
    • The fleet task instant is already in DRAFT status.
    • The fleet task instant is in SCHEDULED status.
    • The fleet task instant is in STARTED status.
    • The fleet task instant is in ENDED status.
    • The fleet task instant is in CANCELED status.

Transitioning Fleet Task Instant To SCHEDULED Status

SCHEDULED status meaning that the fleet task instant is assigned to a vehicle and ready to be started.

  1. Create a fleet task instant

  2. You must assigned a vehicle to the fleet task instant before transitioning it to SCHEDULED status.

    If you have not assigned a vehicle, you can do so by following these steps:

    • Send a PATCH request to the /fleet_task_instant/{id} endpoint to update the vehicle with the following body:
{
"vehicle_id": 12345
}
  1. If you have already assigned a vehicle, you can transition the fleet task instant to STARTED status by following these steps:

    Send a POST request to the /fleet_task_instant/{id}/transition endpoint with the following body:

{
"status": "SCHEDULED"
}
  1. The fleet task instant will be transitioned to SCHEDULED status.
  2. You can change the fleet task instant data while in SCHEDULED status.
  3. You cannot transition a fleet task instant to SCHEDULED when:
    • The fleet task instant is already in SCHEDULED status.
    • The fleet task instant is in STARTED status.
    • The fleet task instant is in ENDED status.
    • The fleet task instant is in CANCELED status.

Transitioning Fleet Task Instant To STARTED Status

STARTED status meaning that the fleet task instant is in progress and the vehicle is on its way to the planned locations.
There are two ways to transition a fleet task instant to STARTED status:

  1. Fleet task instant manually transitioned to STARTED by the user
  2. Fleet task instant automatically transitioned to STARTED by the system

Transitioning Fleet Task Instant To STARTED Status Manually

  1. Create a fleet task instant

  2. You must assigned a vehicle to the fleet task instant before transitioning it to STARTED status.

    If you have not assigned a vehicle, you can do so by following these steps:

    • Send a PATCH request to the /fleet_task_instant/{id} endpoint to update the vehicle with the following body:
{
"vehicle_id": 12345
}
  1. If you have already assigned a vehicle, you can transition the fleet task instant to STARTED status by following these steps:

    Send a POST request to the /fleet_task_instant/{id}/transition endpoint with the following body:

{
"status": "STARTED"
}
  1. The fleet task instant will be transitioned to STARTED status.
  2. You cannot change the fleet task instant data while in STARTED status.
  3. You cannot transition a fleet task instant to STARTED when:
    • The fleet task instant is already in STARTED status.
    • The fleet task instant is in ENDED status.
    • The fleet task instant is in CANCELED status.

Transitioning Fleet Task Instant To STARTED Status Automatically

  1. Create a fleet task instant
  2. You can update the auto_start_type field in the fleet task instant to GEOFENCE like this:
{
"auto_start_type": "GEOFENCE"
}
  1. Then you can transition the fleet task instant to SCHEDULED status by following these steps:
    • Send a POST request to the /fleet_task_instant/{id}/transition endpoint with the following body:
{
"status": "SCHEDULED"
}
  1. Or you can doing it at once when transitioning the fleet task instant to SCHEDULED status by following these steps:
{
"status": "SCHEDULED",
"fields": {
"auto_start_type": "GEOFENCE"
}
}
  1. The vehicle in the fleet task instant that is already in SCHEDULED status and auto_start_type is GEOFENCE will be automatically tracked by the system.
  2. When the vehicle enters the first point geofence in the fleet task instant, the system will automatically transition the fleet task instant to STARTED status.

Transitioning Fleet Task Instant To ENDED Status

ENDED status meaning that the fleet task instant has been completed.
There are two ways to transition a fleet task instant to ENDED status:

  1. Fleet task instant automatically transitioned to ENDED by the system
  2. Fleet task instant manually transitioned to ENDED by the user

Transitioning Fleet Task Instant To ENDED Status Automatically

  1. Create a fleet task instant
  2. The vehicle in the fleet task instant that is already in STARTED status will be automatically tracked by the system.
  3. When there are no point with END type in the fleet task instant:
    • If all points in the fleet task instant are in VISITED status, the system will automatically transition the fleet task instant to ENDED status.
  4. When there are point with END type in the fleet task instant:
    • If all points in the fleet task instant are in VISITED status, except for the point with END type
    • Then if the vehicle visiting the END point, the system will automatically transition the fleet task instant to ENDED status.
  5. You cannot change the fleet task instant data if it already in ENDED status.

Transitioning Fleet Task Instant To ENDED Status Manually

  1. Create a fleet task instant
  2. The fleet task instant must be in STARTED status before transitioning it to ENDED status. You cannot transition a fleet task instant to ENDED unless it is in STARTED status.
  3. Send a POST request to the /fleet_task_instant/{id}/transition endpoint with the following body:
{
"status": "ENDED"
}
  1. The fleet task instant will be transitioned to ENDED status.
  2. You cannot change the fleet task instant data if it already in ENDED status.
  3. This will happen to the points in the fleet task instant when manually transitioned to ENDED status:
    • When there are some points that are still in VISITING status, the system will automatically transition them to VISITED status.
    • When there are some points that are still in WILL_VISITED or MISSED_VISIT status, the system will automatically transition them to NOT_VISITED status.
    • Points that are already in VISITED status will remain in VISITED status.

Transitioning Fleet Task Instant To CANCELED Status

CANCELED status meaning that the fleet task instant has been canceled and will not be completed.

  1. Create a fleet task instant
  2. You can only transition a fleet task instant to CANCELED when:
    • The fleet task instant is in DRAFT status.
    • The fleet task instant is in SCHEDULED status.
    • The fleet task instant is in STARTED status.
  3. Send a POST request to the /fleet_task_instant/{id}/transition endpoint with the following body:
{
"status": "CANCELED",
"fields": {
"reason": "canceled by customer"
}
}
  1. The reason field is required when transitioning the fleet task instant to CANCELED status.
  2. The fleet task instant will be transitioned to CANCELED status.
  3. You cannot change the fleet task instant data if it already in CANCELED status.

Note

  • After creating a fleet task instant, the fleet task instant will not be shown in the list of fleet task instants.
  • To make it visible, you can transition the fleet task instant to other statuses like DRAFT, SCHEDULED, or STARTED

Request

Responses

OK