Skip to main content
Skip to Content
Dispatch API

Batch import drivers

POST
/drivers:import

The playground uses your live account

Requests are sent with your real API key, so creating, updating or deleting here changes your production data.

Creates multiple drivers in your team. The request body must contain an array of drivers to import.

Authorization

BasicAuth
headerAuthorizationBasic <token>

Use the API key as the username and leave the password empty.

Request Body

An array of driver descriptions to be created in batch.

application/json
  1. body

An array of driver descriptions to be created in batch.

Items1 <= items <= 50
[index: integer]?

The request body for creating a driver. Even though email and phone are optional, you must provide exactly one of them

Response Body

Success

application/json
  1. response

Success

success*array<>

The ids of the successfully imported drivers

failed*array<>

The failed drivers

Example Request
curl -X POST 'https://api.spoke.com/public/v1/drivers:import' \  -H 'Content-Type: application/json' \  -d '[  {}]'
Example Response
{  "success": [    "string"  ],  "failed": [    {      "error": {        "message": "string"      },      "driver": {        "name": "string",        "displayName": "string",        "email": "user@example.com",        "phone": "string",        "depots": [          "string"        ],        "routeOverrides": {          "startAddress": {            "addressName": "string",            "addressLineOne": "string",            "addressLineTwo": "string",            "city": "string",            "state": "string",            "zip": "string",            "country": "string",            "latitude": -90,            "longitude": -180          },          "endAddress": {            "addressName": "string",            "addressLineOne": "string",            "addressLineTwo": "string",            "city": "string",            "state": "string",            "zip": "string",            "country": "string",            "latitude": -90,            "longitude": -180          },          "startTime": {            "hour": 0,            "minute": 0          },          "endTime": {            "hour": 0,            "minute": 0          },          "maxStops": 0,          "drivingSpeed": "slower",          "deliverySpeed": "slower",          "vehicleType": "bike"        }      }    }  ]}