Skip to main content
Skip to Content
Dispatch API

Batch import unassigned stops

POST
/unassignedStops: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.

Batch import unassigned stops. The request body must contain an array of unassigned stops to import. Note that the depot is the same for all unassigned stops in a same request. This is because the depot is used as a biasing location for the unassigned stops, so that the geocoding results are more accurate for a same region.

Authorization

BasicAuth
headerAuthorizationBasic <token>

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

Request Body

application/json
  1. body
unassignedStops*array<>

An array of unassigned stops to import in batch. Supports a maximum of 100 unassigned stops per request. Note that the depot is shared across all unassigned stops in the request, and thus should not be provided for individual unassigned stops. That is because the depot location is used to bias the geocoding results of the stops.

Items1 <= items <= 100
depot?|

The Depot ID the unassigned stops in the batch belong to, in the format depot/<id>. This is used to bias the geocoding results of the unassigned stops, so every unassigned stop in the batch should belong to the same depot. If not provided, or null, it will default to the team's main depot.

Response Body

Success

application/json
  1. response

Success

success*array<>

The ids of the successfully imported unassigned stops

failed*array<>

The failed unassigned stops

Example Request
curl -X POST 'https://api.spoke.com/public/v1/unassignedStops:import' \  -H 'Content-Type: application/json' \  -d '{  "unassignedStops": [    {      "address": {}    }  ]}'
Example Response
{  "success": [    "string"  ],  "failed": [    {      "error": {        "message": "string",        "code": "string",        "param": "string"      },      "unassignedStop": {        "address": {          "addressName": "string",          "addressLineOne": "string",          "addressLineTwo": "string",          "city": "string",          "state": "string",          "zip": "string",          "country": "string",          "latitude": -90,          "longitude": -180        },        "recipient": {          "externalId": "string",          "email": "user@example.com",          "phone": "string",          "name": "string"        }      }    }  ]}