Skip to main content
Skip to Content
Dispatch API
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 stops

POST
/plans/{planId}/stops:liveImport

The playground uses your live account

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

Import stops to live plans. When the plan is not writable, this endpoint starts an editing session and the action can be applied through a new optimization, or be discarded.

Authorization

BasicAuth
headerAuthorizationBasic <token>

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

Path Parameters

planId*string

The plan id

Match^[a-zA-Z0-9---_]{1,50}$

Request Body

An array of stops to import in batch. Supports a maximum of 100 stops per request.

application/json
  1. body

An array of stops to import in batch. Supports a maximum of 100 stops per request.

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

The request body for creating a stop. The only required field is address, you need to provide at least one of the fields in it. The latitude and longitude fields will override any of the other fields if they are set(and they need to be both set if any of them are). The more fields you provide the more accurate the geocoding will be.

Response Body

Success

application/json
  1. response

Success

success*array<>

The ids of the successfully imported stops

failed*array<>

The failed stops

pending*boolean
Example Request
curl -X POST 'https://api.spoke.com/public/v0.2b/plans/string/stops:liveImport' \  -H 'Content-Type: application/json' \  -d '[  {    "address": {}  }]'
Example Response
{  "success": [    "string"  ],  "failed": [    {      "error": {        "message": "string"      },      "stop": {        "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"        }      }    }  ],  "pending": true}