Issuing dispatch events

Last updated 8 months ago

Dispatch events allow you to associate jobs with drivers and update job status. When a job is 'dispatched' to a driver, the driver's current location is displayed on the customer tracking link.

Issue a dispatch event

HTTP Request

POST https://prod-api.spatula.io/v2/graph/role/jobs/JOB_ID/dispatches?access_token=AUTH_TOKEN

URL component

Description

JOB_ID

The job's id

Field

Description

vehicle vehicle‚Äč

The vehicle the dispatch event is associated with

type string

The type of dispatch event. This can be either dispatched, returned, underway, or closed.

Types

Type

Description

dispatched

The job will be dispatched to the specified vehicle

returned

The job will be returned from the vehicle

underway

The job is now underway

closed

The job is completed

POST request body

[
{
"vehicle": {
"id": 456128901
},
"type": "dispatched"
}
]

Example

shell
curl -X POST -d '[{"vehicle":{"id":456128901},"type":"dispatched"}]' "https://prod-api.spatula.io/v2/graph/role/jobs/JOB_ID/dispatches?access_token=AUTH_TOKEN"