Skip to content

Latest commit

 

History

History
61 lines (56 loc) · 1.61 KB

File metadata and controls

61 lines (56 loc) · 1.61 KB

home > Trip execution phase > On route

After the asset is in use, the end user can travel. In some scenarios it is requested that the end user can pause and resume the trip. This can also be done by using the same end point for starting the leg.

Step 1: pausing the asset

POST https://exampleTO.com/legs/746ac-48792bb-746dac3/events
{
  "operation": "PAUSE",
  "asset": {
    "assetId": "bike1",
    "place": {
      "coordinates": {
        "lng": 6.169639,
        "lat": 52.253279
      }
    }
  }
}

Step 2: Resuming can be done by using again the 'SET_IN_USE' operation:

POST https://exampleTO.com/legs/746ac-48792bb-746dac3/events/
{
  "operation": "SET_IN_USE",
  "asset": {
    "assetId": "bike1",
    "place": {
      "coordinates": {
        "lng": 6.169639,
        "lat": 52.253279
      }
    }
  }
}

From version 1.1 there is also a facility to use the operations 'TIME_EXTEND' and 'TIME_POSTPONE'. The first one asks the TO to extend the rental period a bit, until the timestamp in the time field.

POST https://exampleTO.com/legs/746ac-48792bb-746dac3/events/
{
  "operation": "TIME_EXTEND",
  "time": "2017-07-21T17:32:28Z"
}

Or, to ask if the asset can be picked up a bit later:

POST https://exampleTO.com/legs/746ac-48792bb-746dac3/events/
{
  "operation": "TIME_POSTPONE",
  "time": "2017-07-21T17:32:28Z"
}

Objects

LegEvent
Leg

Next

End