put https://api.keeptruckin.com/v3/dispatches
Update an existing dispatch
This API only accepts a JSON object in the body of the request and is used to update an existing dispatch. The JSON object should take the general form illustrated in this example.
{
"vendor_id":"VV-1",
"status":"planned",
"dispatch_stops":[
{
"vendor_id":"VDS-1",
"type":"pickup",
"number":1,
"early_date":"2023-03-13T19:13:00+00:00",
"late_date":"2023-03-15T19:13:00+00:00",
"form_ids":[
"1ee148ac-6083-4b5a-af7b-75b875bb233f",
"f60e5305-c2e2-45d7-97d7-eb4760b1a973"
],
"vendor_dispatch_location_id":"VDSL-1",
"status":"available"
}
],
"dispatch_trips":[
{
"vendor_id":"VT-1",
"vehicle_id":64734,
"driver_id":1088505,
"vendor_stop_ids":[
"VDS-1"
],
"status":"not_started"
}
]
}
To update an existing dispatch, supply the entire dispatch object again with updated information to this API. To remove a dispatch stop or trip, supply the entire dispatch object again, without the information for the dispatch stop/trip created before. You can simply pass a {vendor_id: XYZ} for a dispatch stop/trip in the dispatch trips/stops array to persist the trip/stop through API calls.