This is the documentation for Dispatch API v0.2b, which is no longer actively maintained. For up-to-date documentation, see the latest version (v1.0).
Batch import drivers
POST
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.
BasicAuthheader
AuthorizationBasic <token>Use the API key as the username and leave the password empty.
An array of driver descriptions to be created in batch.
application/json- body
An array of driver descriptions to be created in batch.
Items
1 <= 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
Success
application/json- response
Success
success*array<>The ids of the successfully imported drivers
failed*array<>The failed drivers
curl -X POST 'https://api.spoke.com/public/v0.2b/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" } } } ]}