NAV Navbar
Logo
http+json shell

Introduction

WorkWave Route Manager (WWRM) exposes its data via an Application Programming Interface (API). This document is the official reference for that functionality.

Basic concepts

Assumptions

Throughout this document it is assumed that the reader is well acquainted with the WorkWave Route Manager Web Application, its features and terminology.

The API is entirely HTTP-based

Methods to retrieve data from the API require a GET request. Methods that submit or change data require a POST. Methods that destroy data require a DELETE. API Methods that require a particular HTTP method will return an error if you do not make your request with the correct one. HTTP Response Codes are meaningful.

The API is a RESTful resource

The API attempts to conform to the design principles of Representational State Transfer (REST). More details on REST can be found here. Libraries to build REST-compatible API clients are readily available for several programming languages. A list of REST frameworks is available at the bottom of the above mentioned page.

The format used for structured data exchange is JSON

The API supports the JSON (JavaScript Object Notation) format. Details on how JSON works can be found here and here. Libraries that convert to and from the JSON format are readily available for popular and less popular programming languages. A full index, sorted by language, can be found at the bottom of this page

The API works with both plain HTTP and HTTP-within-SSL/TLS (HTTPS). HTTPS is highly recommended to avoid passing both the authentication KEY and potentially confidential data (e.g.: clients’ names and addresses) in clear text over the web.

Parameters have certain expectations

Some API methods take optional or requisite parameters. Please keep in mind that all query-string parameter values should be converted to UTF-8 and URL encoded.

Authentication

Authentication is performed using an API key provided by WorkWave. The API key must be included in the HTTP(S) request using one of the following two methods:

Where both are provided the query-string parameter takes precedence.

The API key is a string, more specifically it is a UUID in its canonical form (e.g.: “123e4567-e89b-12d3-a456-426655440000”).

Asynchronous requests

All requests that add, update or delete data (write-requests) are asynchronous.

All asynchronous requests return immediately with a requestId. The actual response, complete with the requestId, is POSTed to the notifications callback URL as soon as the originating request is processed (see the following paragraph for more details about notifications).

Notifications

The WorkWave Route Manager API supports a notification mechanism based on HTTP callbacks (aka web-hooks).

A callback URL is defined on a per-account basis to receive event notifications. Notification messages are POSTed to the callback URL.

Notifications include:

Queueing and Throttling

All asynchronous API requests are queued on a per-territory basis and processed one by one in the order they have been queued (FIFO).

The queue has a maximum size of 10 items. Attempting to queue more than this number of requests will return a 429 “Too Many Requests” error.

Throttling and rate-limiting schemes are applied on a per-territory and per-request-type basis to both synchronous and asynchronous requests to prevent overloading the system with too many / too fast requests.

HTTP Response Codes and Errors

HTTP Status Codes

The WorkWave Route Manager API attempts to return appropriate HTTP status codes for every request.

Error Messages

{
  "errorCode": 600,
  "errorMessage": "Adding 75 Orders to the existing 980 exceeds the maximum of 1000 allowed for operations on territory [New York]"
}

When the WorkWave Route Manager API returns error messages, it does so in JSON format. See examples in the right panel.

Error Codes

Error codes, as found in the body of returned error messages, further define the scope of an error. The following error codes may be returned:

Core API sets and use cases

WorkWave Route Manager offers four different API sets, where each set is dedicated to specific use cases.

Orders API set

Allows for CRUD operations on Orders.

Its main purpose is to allow automated synchronization of Order data between WorkWave Route Manager and ERP Systems.

Asynchronous notifications are POSTed to the callback URL whenever an Order is updated, either as a consequence of our direct actions or by some other actor (other API user or human user logged into the Web Application).

Notifications are about changes to “static”, Order-definition data (e.g.: address, service time, time window, loads) and do not include updates about “live” data such as ETAs and Execution Events (e.g.: time-in, time-out) received from Mobile Applications; that is the purpose of the TimeOfArrival API.

Time Of Arrival API set

Allows updating and retrieval of live routes data, including updated time of arrival information. Enables use cases such as:

Approved Plans API set

Allows retrieval of approved route plan data as well as approving, and revoking approval of, Routes on a per-date basis.

Asynchronous notifications are POSTed to the callback URL whenever routes planned for a date are marked or unmarked as “approved”.

Enables use cases such as:

Scheduling API set

Provide means to assign and unassign Orders to/from Routes exposing functionality like full plan (re)optimization, fitting-in unassigned Orders and explicitly unassigning Orders from their current Routes.

Asynchronous notifications are POSTed to the callback URL whenever a scheduling event completes.

Enables use cases such as:

GPS Tracking API set

Allows retrieval of GPS tracking data like current and historical [planned] data like position, heading, speed, etc

Enables use cases such as:

Proposals API set

The Proposals API set allows for obtaining real-time information as to where a new Order could be inserted into existing planned routes or empty routes. Its main characteristic is that it accepts multiple time slots to be investigated in parallel.

The returned result is a set of “proposals”, one per slot, with a preview of the Route in case the Order fits into the slot.

If one of the proposals is accepted the Order is added to the plan, already assigned to the proposed Route.

Enables use cases such as:

Helper API sets

In addition to the core API sets, the following additional helper REST resources are available:

Callback API

Get Callback URL

curl https://wwrm.workwave.com/api/v1/callback?key=AUTH_KEY
GET /api/v1/callback HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "url": "https://my.server.com/callback"
}

Returns the callback URL (synchronous).

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/callback

THROTTLING

Leaky bucket (size:5, refill: 1 per 5 minutes)

RETURN VALUES

Property Type Description
url String The callback URL

Set Callback URL

curl -H "Content-Type: application/json" -X POST -d '{"url":"https://my.server.com/new-callback", "test": true}' https://wwrm.workwave.com/api/v1/callback?key=AUTH_KEY
POST /api/v1/callback HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

{
  "url": "https://my.server.com/new-callback",
  "signaturePassword": "g394g732vhsdfiv34",
  "test": true
}

The above command returns JSON structured like this:

{
  "url": "https://my.server.com/new-callback",
  "previousUrl": "https://my.server.com/callback"
}

And in case the test fails:

{
  "errorCode": 2000,
  "errorMessage": "Server at URL [https://my.server.com/callback] failed to respond to the test message. Expected HTTP code [200], received [404]"
}

The POSTed test message looks something like this:

POST /new-callback?reqId=test HTTP/1.0
Host: my.server.com
Accept-Encoding: gzip,deflate
Connection: close
Content-Length: 96
Content-Type: application/json; charset=UTF-8
User-Agent: WorkWaveRouteManager-WebHook/1.0

{
    "requestId": "test",
    "territoryId": "test",
    "event": "test",
    "data": "test"
}

HMAC computation pseudocode. See also examples in other languages

var message = "https://my.server.com/new-callback?reqID=test&nonce=8cf95201-4d3c-4397-9117-d7ee6ad89d93";
var secret = "g394g732vhsdfiv34";
var hash = CryptoJS.HmacSHA256(message, secret);
var signature = hash.toString(CryptoJS.enc.Base64); // ihyCCfTHog7TDQYT4tQM5ISYSjEIaChSeJmIo3UMa+U=

HMAC verification pseudocode

var inboundRequestUrl = "https://my.server.com/new-callback?reqID=test&nonce=8cf95201-4d3c-4397-9117-d7ee6ad89d93&signature=ihyCCfTHog7TDQYT4tQM5ISYSjEIaChSeJmIo3UMa"
var signatureFromUrl = new URL(inboundRequestUrl).getQueryStringParameter("signature");
// strip the "signature" parameter from the URL without otherwise altering either the content or the sequence of the other URL parameters
var inboundRequestUrlWithoutSignature = "https://my.server.com/new-callback?reqID=test&nonce=8cf95201-4d3c-4397-9117-d7ee6ad89d93";
var secret = "g394g732vhsdfiv34";
var hash = CryptoJS.HmacSHA256(inboundRequestUrlWithoutSignature, secret);
var computedSignature = hash.toString(CryptoJS.enc.Base64);
var isUrlOk = computedSignature == signatureFromUrl;

Sets the callback URL (synchronous).

THROTTLING

Leaky bucket (size:5, refill: 1 per 5 minutes)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/callback

REQUEST BODY

Property Type Description
url String The callback URL
signaturePassword String Optional, defaults to null. If set, both a nonce and a signature parameter are added to the querystring of each POSTed callback. signature is set to the base64 hash computed using HMAC-SHA256 where message is the full URL w/ querystring and secret is signaturePassword. See also the pseudocode in the right panel. This allows the request to be authenticated and to confirm that it is coming from WorkWave Route Manager servers.
test boolean Optional, defaults to false. If true a test callback message is synchronously POSTed to the remote server. url is only set if the response is a 200 OK, otherwise a 400 BAD REQUEST error is returned with a message detailing the failure reason

RETURN VALUES

Property Type Description
previousUrl String The previous callback URL
url String The current callback URL

Delete Callback URL

curl -X DELETE https://wwrm.workwave.com/api/v1/callback?key=AUTH_KEY
DELETE /api/v1/callback HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{
  "url": null,
  "previousUrl": "https://my.server.com/callback"
}

Deletes the callback URL and the accompanying signaturePassword, if set, disabling all notifications (synchronous).

THROTTLING

Leaky bucket (size:5, refill: 1 per 5 minutes)

HTTP REQUEST

DELETE https://wwrm.workwave.com/api/v1/callback

RETURN VALUES

Property Type Description
previousUrl String The previous callback URL
url String The current callback URL (null in this case)

Territories API

List Territories

curl https://wwrm.workwave.com/api/v1/territories?key=AUTH_KEY
GET /api/v1/territories HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "territories": {
    "429defc8-5b05-4c3e-920d-0bb911a61345": {
      "id": "429defc8-5b05-4c3e-920d-0bb911a61345",
      "name": "API DEMO",
      "center": [
        33831218,
        -87277506
      ],
      "timeZoneCode": "America/New_York",
      "languageCode": "en"
    }
  }
}

List all available Territories (synchronous).

THROTTLING

Leaky bucket (size:5, refill: 1 per 5 minutes)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories

RETURN VALUES

Property Type Description
territories map[UUID]Territory A map where the key is the territoryId and the value is the associated Territory object

Depots API

List Depots

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/depots?key=AUTH_KEY
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/depots HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "depots": {
    "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
      "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
      "name": "Depot A",
      "setupCost": -1,
      "setupTimeSec": -1,
      "location": {
        "address": "320 20th St W, Jasper, AL 35501, USA",
        "latLng": [
          33831316,
          -87278355
        ],
        "status": "OK"
      },
      "color": "998800"
    }
  }
}

List all available Depots (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per minute)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/depots

RETURN VALUES

Property Type Description
depots map[UUID]Depot A map where the key is the depotId and the value is the associated Depot object

Regions API

List Regions

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/regions?key=AUTH_KEY
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/regions HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "regions": {
    "ddcbe348-5b4d-483d-9d6c-1b149120ca7e": {
      "id": "ddcbe348-5b4d-483d-9d6c-1b149120ca7e",
      "name": "South Jasper",
      "color": "2E5984",
      "poly": [
        [33840336, -87319165],
        [33839766, -87220803],
        [33794127, -87229386],
        [33792558, -87245007],
        [33812528, -87259598],
        [33812956, -87305947],
        [33812956, -87325860]
      ],
      "enterCost": 2000,
      "enterTimeSec": 1200
    }
  }
}

List all available Regions (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per 10 seconds)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/regions

RETURN VALUES

Property Type Description
regions map[UUID]Region A map where the key is the regionId and the value is the associated Region object

Drivers API

List Drivers

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers?key=AUTH_KEY
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "drivers": {
    "a3935987-4944-462f-b602-4a3a12beeeff": {
      "id": "a3935987-4944-462f-b602-4a3a12beeeff",
      "name": "Driver 1",
      "email": "driver1@example.com"
    },
    "a08213e6-673f-4efc-955e-2bf587813162": {
      "id": "a08213e6-673f-4efc-955e-2bf587813162",
      "name": "Driver 2",
      "email": "driver2@example.com"
    }
  }
}

List all available Drivers (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per minute)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/drivers

RETURN VALUES

Property Type Description
drivers map[UUID]Driver A map where the key is the driverId and the value is the associated Driver object

Add Driver

Add Driver Request

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "name": "Driver 3",
  "email": "driver3@example.com",
  "password": "PhQ?Hqrt$4bs6_^2"
}

The above command returns JSON structured like this:

{
  "requestId": "74069cf8-6d58-416d-96ba-bbc9b48429c6"
}

And triggers a DriversChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "74069cf8-6d58-416d-96ba-bbc9b48429c6",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "driversChanged",
  "data": {
    "created": [
      "0129724f-b80d-4011-ab91-3e4ae2f62896"
    ],
    "updated": [],
    "deleted": []
  }
}

Add one Driver (asynchronous).

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/drivers

THROTTLING

Leaky bucket (size:10, refill: 1 per 10 seconds)

REQUEST BODY

DriverInput

The system will assign a UUID to the Driver and return it in the driversChanged notification message in the created list

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to driversChanged
data DriversChanged OR ErrorResponse

Replace a Driver

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers/0129724f-b80d-4011-ab91-3e4ae2f62896?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers/0129724f-b80d-4011-ab91-3e4ae2f62896 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "name": "Driver 3 - Replaced",
  "email": "driver3replaced@example.com",
  "password": "newpassword (optional: leave field blank to keep current password)"
}

The above command returns JSON structured like this:

{
  "requestId": "aae30294-8731-4dfb-93c9-6397d76c5055"
}

And triggers a DriversChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "aae30294-8731-4dfb-93c9-6397d76c5055",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "driversChanged",
  "data": {
    "created": [],
    "updated": [
      "0129724f-b80d-4011-ab91-3e4ae2f62896"
    ],
    "deleted": []
  }
}

Overwrite a Driver with new data (asynchronous).

If the updated Driver is logged on to the mobile application and the password is changed, she will be immediately logged out.

THROTTLING

Leaky bucket (size:10, refill: 1 per 10 seconds)

HTTP REQUEST

PUT https://wwrm.workwave.com/api/v1/territories/:territoryId/drivers/:driverId

REQUEST BODY

DriverInput object

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to driversChanged
data DriversChanged OR ErrorResponse

Delete a Driver

curl -X DELETE https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers/0129724f-b80d-4011-ab91-3e4ae2f62896?key=AUTH_KEY
DELETE /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers/0129724f-b80d-4011-ab91-3e4ae2f62896 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{
  "requestId": "9cceb7c7-c6fb-4843-b8c9-608cf87964f9"
}

And triggers a DriversChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "9cceb7c7-c6fb-4843-b8c9-608cf87964f9",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "driversChanged",
  "data": {
    "created": [],
    "updated": [],
    "deleted": [
      "0129724f-b80d-4011-ab91-3e4ae2f62896"
    ]
  }
}

Delete a Driver (asynchronous).

If the Driver is logged on to the mobile application she will be immediately logged out.

THROTTLING

Leaky bucket (size:10, refill: 1 per 10 seconds)

HTTP REQUEST

DELETE https://wwrm.workwave.com/api/v1/territories/:territoryId/drivers/:driverId

RETURN VALUES (notification)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to driversChanged
data DriversChanged OR ErrorResponse

Vehicles API

List Vehicles

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/vehicles?key=AUTH_KEY
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/vehicles HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "vehicles": {
    "0d8855e6-28a0-4e89-9c67-b44c66c39ba6": {
      "id": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "idx": 1,
      "externalId": "Vehicle 1",
      "tracked": true,
      "color": "009944"
    },
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "idx": 2,
      "externalId": "Vehicle 2",
      "tracked": true,
      "color": "5500FF"
    }
  }
}

List all available Vehicles (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per minute)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/vehicles

RETURN VALUES

Property Type Description
vehicles map[UUID] Vehicle A map where the key is the vehicleId and the value is the associated Vehicle object

Get Vehicle Settings

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/vehicles/31656f79-cba7-4bcf-a959-e3fe3f7ca2a7/20151203?key=AUTH_KEY
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/vehicles/31656f79-cba7-4bcf-a959-e3fe3f7ca2a7/20151203 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "settings": {
    "available": true,
    "notes": "",
    "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
    "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
    "timeWindow": {
      "startSec": 28800,
      "endSec": 61200
    },
    "flexStartTime": true,
    "perStopCost": 0,
    "perStopTimeSec": 0,
    "maxWorkingTimeSec": 0,
    "maxDrivingTimeSec": 0,
    "maxDistanceMt": 0,
    "breaks": [],
    "loadCapacities": {
      "people": 600
    },
    "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
    "activationCost": 0,
    "drivingTimeCost": 2000,
    "idleTimeCost": 2000,
    "serviceTimeCost": 2000,
    "breakTimeCost": 2000,
    "kmCost": 100,
    "tags": [
      "heavy"
    ],
    "speedFactor": 100
  }
}

Get Vehicle Settings for a given date (synchronous).

THROTTLING

Leaky bucket (size:20, refill: 3 per second)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/vehicles/:vehicleId/:date

PATH PARAMETERS

Property Type Description
date DateString Settings for this date are returned

RETURN VALUES

Property Type Description
settings VehicleSettings The settings object

Replace Vehicle Settings

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/vehicles/31656f79-cba7-4bcf-a959-e3fe3f7ca2a7/20151203?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/vehicles/31656f79-cba7-4bcf-a959-e3fe3f7ca2a7/20151203 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "available": true,
  "notes": "updated via API",
  "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
  "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
  "timeWindow": {
    "startSec": 28800,
    "endSec": 61200
  },
  "flexStartTime": true,
  "perStopCost": 0,
  "perStopTimeSec": 0,
  "maxWorkingTimeSec": 0,
  "maxDrivingTimeSec": 0,
  "maxDistanceMt": 0,
  "breaks": [
    {
      "startSec": 43200,
      "endSec": 48600,
      "durationSec": 1800
    }
  ],
  "loadCapacities": {
    "people": 600
  },
  "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
  "activationCost": 0,
  "drivingTimeCost": 2000,
  "idleTimeCost": 2000,
  "serviceTimeCost": 2000,
  "breakTimeCost": 2000,
  "kmCost": 100,
  "tags": [
    "heavy",
    "medium"
  ],
  "speedFactor": 120
}

The above command returns JSON structured like this:

{
  "requestId": "c8909d6c-c7b2-4f15-ac43-d0ae935de91a"
}

And triggers an VehiclesChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "c8909d6c-c7b2-4f15-ac43-d0ae935de91a",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "vehiclesChanged",
  "data": {
    "created": [],
    "updated": [
      "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7"
    ],
    "deleted": []
  }
}

Replace current Vehicle Settings with the given ones for the given date (asynchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 every 2 seconds)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/vehicles/:vehicleId/:date

PATH PARAMETERS

Property Type Description
date DateString Settings for this date are replaced. Cannot be a past date and cannot be more than 10 days into the future

REQUEST BODY

VehicleSettings object

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to vehiclesChanged
data VehiclesChanged OR ErrorResponse

Vehicle-Driver Assignments API

Get Driver Assignments

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/vehicledriverassignments/20151203?key=AUTH_KEY
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/vehicledriverassignments/20151203 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "assignments": {
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": "a3935987-4944-462f-b602-4a3a12beeeff",
    "0d8855e6-28a0-4e89-9c67-b44c66c39ba6": "a08213e6-673f-4efc-955e-2bf587813162"
  }
}

Get all vehicle-to-driver assignments for the given date (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per second)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/vehicledriverassignments/:date

PATH PARAMETERS

Property Type Description
date DateString Assignments for this date are returned

RETURN VALUES

Property Type Description
assignments map[UUID] [UUID] A map where the key is the vehicleId and the value is the associated driverId

Replace Driver Assignments

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers/20151203?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/drivers/20151203 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "assignments": {
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": "a08213e6-673f-4efc-955e-2bf587813162",
    "0d8855e6-28a0-4e89-9c67-b44c66c39ba6": "a3935987-4944-462f-b602-4a3a12beeeff"
  }
}

The above command returns JSON structured like this:

{
  "requestId": "c1b9fe04-9ab2-4aac-9a9b-055c63070319"
}

And triggers an VehicleDriverAssignmentsChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "c1b9fe04-9ab2-4aac-9a9b-055c63070319",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "vehicleDriverAssignmentsChanged",
  "data": {}
}

Replace all existing vehicle-to-driver assignments for the given date with new ones (asynchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per 10 seconds)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/vehicledriverassignments/:date

PATH PARAMETERS

Property Type Description
date DateString Assignments for this date are replaced. Cannot be a past date and cannot be more than 10 days into the future

REQUEST BODY

Property Type Description
assignments map [UUID] [UUID] A map where keys are vehicleIds and values are the associated driverIds

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to vehicleDriverAssignmentsChanged
data empty object OR ErrorResponse

Orders API

List Orders

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders?key=AUTH_KEY&include=all
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "orders": {
    "4516b2e1-43dc-49a8-8bfb-7190fa60df21": {
      "id": "4516b2e1-43dc-49a8-8bfb-7190fa60df21",
      "name": "Order 1",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204",
          "20151205",
          "20151206"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA",
          "latLng": [
            33817872,
            -87266893
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 30600,
            "endSec": 37800
          },
          {
            "startSec": 45000,
            "endSec": 55800
          }
        ],
        "notes": "demonstrate the concept of multiple time windows as well as eligibility date range",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    },
    "0d56e7a3-c737-472e-bec9-e2f19d4865d3": {
      "id": "0d56e7a3-c737-472e-bec9-e2f19d4865d3",
      "name": "Order 2",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 20,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "701-799 Birmingham Ave, Jasper, AL 35501, USA",
          "latLng": [
            33845214,
            -87273604
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 32400,
            "endSec": 43200
          }
        ],
        "notes": "Demonstrate the concept of priority and notes (Driver must use the back door to enter the building)",
        "serviceTimeSec": 1800,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    },
    "407df645-bca8-4d3d-aa84-6dafcf1296a4": {
      "id": "407df645-bca8-4d3d-aa84-6dafcf1296a4",
      "name": "Order 3",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 10,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "710 7th Ave, Jasper, AL 35504, USA",
          "latLng": [
            33849682,
            -87282890
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 39600,
            "endSec": 46800
          }
        ],
        "notes": "demonstrate the concept of custom Fields",
        "serviceTimeSec": 300,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {
          "Phone Extensions ": "76"
        }
      },
      "isService": false
    },
    "c5b66e27-eb70-43fb-be54-37a2f7ef723e": {
      "id": "c5b66e27-eb70-43fb-be54-37a2f7ef723e",
      "name": "Order 4",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {
        "frozen ton": 100,
        "regular ton": 300
      },
      "pickup": {
        "depotId": null,
        "location": {
          "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
          "latLng": [
            33480873,
            -86788220
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "demonstrate the concept of loads. Furthermore this Order involves both a Pickup and a Delivery (meaning that the Vehicle servicing it will pick up loads at one location and delivered them at a different location)",
        "serviceTimeSec": 0,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": {
        "depotId": null,
        "location": {
          "address": "1411 Indiana Ave, Jasper, AL 35501, USA",
          "latLng": [
            33836824,
            -87266029
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 46800,
            "endSec": 52200
          },
          {
            "startSec": 55800,
            "endSec": 59400
          }
        ],
        "notes": "Fragile",
        "serviceTimeSec": 1500,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {
          "Building Entrance Code": "0000"
        }
      },
      "isService": false
    },
    "0f397b30-b068-4e4f-8d78-d4b0c231e6c1": {
      "id": "0f397b30-b068-4e4f-8d78-d4b0c231e6c1",
      "name": "Order 5",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": null,
          "latLng": [
            33847059,
            -87296707
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of using coordinates(longitude and latitude) data instead of address",
        "serviceTimeSec": 1800,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    },
    "903a7eda-b27d-499c-b70c-58258449470a": {
      "id": "903a7eda-b27d-499c-b70c-58258449470a",
      "name": "Order 6",
      "eligibility": {
        "type": "any"
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {
        "people": 400
      },
      "pickup": {
        "depotId": null,
        "location": {
          "address": null,
          "latLng": [
            33480873,
            -86788220
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of force a vehicle to serve an order, apply different eligibility type ",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": null,
      "isService": false
    },
    "f8ad4ee8-89b6-4e57-8d5d-3c0838d03ea7": {
      "id": "f8ad4ee8-89b6-4e57-8d5d-3c0838d03ea7",
      "name": "Order 7",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "1300 S Skyline Dr, Jasper, AL 35501, USA",
          "latLng": [
            33843834,
            -87315561
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of tags in/out",
        "serviceTimeSec": 1800,
        "tagsIn": [
          "frozen",
          "regular"
        ],
        "tagsOut": [
          "heavy"
        ],
        "customFields": {}
      },
      "isService": false
    }
  },
  "depots": {}
}

List current (not yet archived) Orders, optionally filtering by assigned/unassigned status (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per minute)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/orders[?include=all|assigned|unassigned]

QUERYSTRING PARAMETERS

Property Type Description
include enum Optional. If not specified defaults to “all”. Can be one of:
“all”: include all current (not archived) Orders
“assigned”: include only Orders that are assigned to a Route
“unassigned”: include only Orders that are not assigned to a Route
An Order is considered “assigned” if it is associated to a Route and therefore is or will be visited by a Vehicle driven by a Driver
Note: if an Order that is part of a Route ends up being skipped by the Vehicle that is supposed to visit it, it will still fall in the “assigned” category. That is to say that “assigned” actually means “planned as assigned”
Note: if an Order defines both pickup and delivery OrderSteps, but only one of them is associated to a Route, the Order will be listed in both “assigned” and “unassigned” categories

RETURN VALUES

Property Type Description
orders map[UUID]Order A map where the key is the orderId and the value is the associated Order object
depots map[UUID]Depot A map where the key is the depotId and the value is the associated Depot object. Includes Depots referenced by the listed Orders (if any)

Get Orders

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders?key=AUTH_KEY&ids=4516b2e1-43dc-49a8-8bfb-7190fa60df21,0d56e7a3-c737-472e-bec9-e2f19d4865d3
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders?ids=4516b2e1-43dc-49a8-8bfb-7190fa60df21,0d56e7a3-c737-472e-bec9-e2f19d4865d3 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "orders": {
    "4516b2e1-43dc-49a8-8bfb-7190fa60df21": {
      "id": "4516b2e1-43dc-49a8-8bfb-7190fa60df21",
      "name": "Order 1",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204",
          "20151205",
          "20151206"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA",
          "latLng": [
            33817872,
            -87266893
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 30600,
            "endSec": 37800
          },
          {
            "startSec": 45000,
            "endSec": 55800
          }
        ],
        "notes": "demonstrate the concept of multiple time windows as well as eligibility date range",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    },
    "0d56e7a3-c737-472e-bec9-e2f19d4865d3": {
      "id": "0d56e7a3-c737-472e-bec9-e2f19d4865d3",
      "name": "Order 2",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 20,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "701-799 Birmingham Ave, Jasper, AL 35501, USA",
          "latLng": [
            33845214,
            -87273604
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 32400,
            "endSec": 43200
          }
        ],
        "notes": "Demonstrate the concept of priority and notes (Driver must use the back door to enter the building)",
        "serviceTimeSec": 1800,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    }
  },
  "depots": {}
}

Get the given Orders (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per minute)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/orders?ids=<comma_separated_list>

QUERYSTRING PARAMETERS

Property Type Description
ids comma-separated list of String Optional. If not specified or empty all current Orders are returned

RETURN VALUES

Property Type Description
orders map[UUID]Order A map where the key is the orderId and the value is the associated Order object
depots map[UUID]Depot A map where the key is the depotId and the value is the associated Depot object. Includes Depots referenced by the listed Orders (if any)

Add Orders

Add Single Order Request

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "orders": [
    {
      "name": "Order 6 - API",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {
        "people": 2
      },
      "delivery": {
        "location": {
          "address": "2001 2nd Ave, Jasper, AL 35501, USA"
        },
        "timeWindows": [
          {
            "startSec": 43200,
            "endSec": 54000
          }
        ],
        "notes": "Order added via API",
        "serviceTimeSec": 1800,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {
          "my custom field": "custom field content",
          "orderId": "abcd1234"
        }
      }
    }
  ]
}

The above command returns JSON structured like this:

{
  "requestId": "509900a5-392e-4d34-bcfe-90cc6bf3ad47"
}

And triggers an OrdersChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "509900a5-392e-4d34-bcfe-90cc6bf3ad47",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [
      {
        "id":"fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "geocodeStatus": {
          "delivery":"OK"
        }
      }
    ],
    "updated": [],
    "deleted": []
  }
}

Add Multiple Orders Request

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "orders": [
    {
      "name": "Order 1",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204",
          "20151205",
          "20151206"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA"
        },
        "timeWindows": [
          {
            "startSec": 30600,
            "endSec": 37800
          },
          {
            "startSec": 45000,
            "endSec": 55800
          }
        ],
        "notes": "demonstrate the concept of multiple time windows as well as eligibility date range",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    },
    {
      "name": "Order 2",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 20,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "701-799 Birmingham Ave, Jasper, AL 35501, USA"
        },
        "timeWindows": [
          {
            "startSec": 32400,
            "endSec": 43200
          }
        ],
        "notes": "Driver must use the back door to enter the building. Demonstrate the concept of notes and priority",
        "serviceTimeSec": 1800,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    },
    {
      "name": "Order 3",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 10,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "gibberish gibberish gibberish"
        },
        "timeWindows": [
          {
            "startSec": 39600,
            "endSec": 46800
          }
        ],
        "notes": "Demonstrates the concept of Custom Fields & the result of an invalid address",
        "serviceTimeSec": 300,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {
          "Phone Extensions ": "76"
        }
      },
      "isService": false
    },
    {
      "name": "Order 4",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {
        "frozen ton": 100,
        "regular ton": 300
      },
      "pickup": {
        "depotId": null,
        "location": {
          "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
          "latLng": [
            33480873,
            -86788220
          ]
        },
        "timeWindows": [],
        "notes": "demonstrate the concept of loads. Furthermore this Order involves both a Pickup and a Delivery (meaning that the Vehicle servicing it will pick up loads at one location and deliver them at a different location)",
        "serviceTimeSec": 0,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": {
        "depotId": null,
        "location": {
          "address": "1411 Indiana Ave, Jasper, AL 35501, USA",
          "latLng": [
            33836824,
            -87266029
          ]
        },
        "timeWindows": [
          {
            "startSec": 46800,
            "endSec": 52200
          },
          {
            "startSec": 55800,
            "endSec": 59400
          }
        ],
        "notes": "Fragile",
        "serviceTimeSec": 1500,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {
          "Building Entrance Code": "0000"
        }
      },
      "isService": false
    },
    {
      "name": "Order 5",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "latLng": [
            33847059,
            -87296707
          ]
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of using coordinates(longitude and latitude) data instead of address",
        "serviceTimeSec": 1800,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    },
    {
      "name": "Order 6",
      "eligibility": {
        "type": "any"
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {
        "people": 400
      },
      "pickup": {
        "depotId": null,
        "location": {
          "latLng": [
            33480873,
            -86788220
          ]
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of forceful vehicle assignment",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": null,
      "isService": false
    },
    {
      "name": "Order 7",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "1300 S Skyline Dr, Jasper, AL 35501, USA",
          "latLng": [
            33843834,
            -87315561
          ]
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of tags in/out",
        "serviceTimeSec": 1800,
        "tagsIn": [
          "frozen",
          "regular"
        ],
        "tagsOut": [
          "heavy"
        ],
        "customFields": {}
      },
      "isService": false
    }
  ]
}

The above command returns JSON structured like this:

{
  "requestId": "0092906c-7416-43a5-8253-13ef2318b773"
}

And triggers an OrdersChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "0092906c-7416-43a5-8253-13ef2318b773",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [
      {
        "id":"17646990-e888-4e81-8d36-88976e1e3cfa",
        "geocodeStatus": {
          "delivery":"OK"
        }
      },
      {
        "id":"be928f79-10ea-4c3e-94cc-48d3672ed7a0",
        "geocodeStatus": {
          "delivery":"OK"
        }
      },
      {
        "id":null,
        "geocodeStatus": {
          "delivery":"NOT_FOUND"
        }
      },
      {
        "id":"d046b2cd-6b92-425d-ad47-80ae36b73220",
        "geocodeStatus": {
          "delivery":"OK"
        }
      },
      {
        "id":"392bbf0b-8ba0-4c9e-b18b-dc7968a8600a",
        "geocodeStatus": {
          "delivery":"OK"
        }
      },
      {
        "id":"c3653ce3-60d5-43a5-b68d-8c28988d1a26",
        "geocodeStatus": {
          "delivery":"OK"
        }
      },
      {
        "id":"df365bcd-37b8-4b22-920c-649fbec569b6",
        "geocodeStatus": {
          "delivery":"OK"
        }
      }
    ],
    "updated": [],
    "deleted": []
  }
}

Add one or more Orders (asynchronous).

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/orders

THROTTLING

Leaky bucket (size:60, refill: 1 per second)

REQUEST BODY

Property Type Description
orders list of OrderInput List of Orders to be added. The system will assign a UUID to each Order and return it in the ordersChanged notification message in the created list (e.g.: the UUID assigned to the 3rd Order in the input orders list is the 3rd UUID in the OrdersChanged.created field)
strict boolean Optional, defaults to true.

When set to true and one or more Orders does not pass formal validation checks (e.g.: eligibility date set in the past, a time window spanning more than 24 hours, etc) the request fails and no Orders are added. Details about the failed validation are reported in the asynchronous error notification.

When set to false Orders that do not pass formal validation checks are skipped without causing the whole request to fail.
IMPORTANT: If formal data validation is ok but one or more Orders still cannot be added because of a wrong or non-existing address, the request is accepted and all Orders with a valid address are added. Orders with an address that failed to be geocoded are not added (unless acceptBadGeocodes is true) and their corresponding index in the created list returned by the asynchronous notification contains a ChangedOrder entry where id=null.
acceptBadGeocodes boolean Optional, defaults to false.

When set to false Orders that cannot be geocoded (i.e.: either the address is unknown OR the geocoded coordinates fall outside of the territory range) are skipped.

When set to true all Orders are added regardless of geocoding issues. In that case it will be possible to review and fix them manually from the Web Application
IMPORTANT: When acceptBadGeocodes is true Orders that fail to be geocoded and have missing or invalid coordinates will be ignored by Build Routes and Fit-In requests

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to ordersChanged
data OrdersChanged OR ErrorResponse

Replace an Order

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "name": "Order 6 - Replaced",
  "eligibility": {
    "type": "on",
    "onDates": [
      "20151204"
    ]
  },
  "forceVehicleId": null,
  "priority": 0,
  "loads": {
    "people": 6
  },
  "delivery": {
    "location": {
      "address": "2002 2nd Ave, Jasper, AL 35501, USA"
    },
    "timeWindows": [
      {
        "startSec": 43200,
        "endSec": 54000
      }
    ],
    "notes": "Order replaced via API",
    "serviceTimeSec": 900,
    "tagsIn": [],
    "tagsOut": [],
    "customFields": {
      "my custom field": "custom field content",
      "orderId": "abcd1234"
    }
  }
}

The above command returns JSON structured like this:

{
  "requestId": "cdecbe3a-4115-4240-8d44-0cfa2fc14fb6"
}

And triggers an OrdersChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "cdecbe3a-4115-4240-8d44-0cfa2fc14fb6",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [
      {
        "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "geocodeStatus": {
          "delivery": "OK"
        }
      }
    ],
    "deleted": []
  }
}

Overwrite an Order with new data (asynchronous).

If the Order is part of a Route, Time Of Arrival information for that Route might change accordingly (e.g.: if the new data changes the service time or the address of the Order).

THROTTLING

Leaky bucket (size:60, refill: 20 per minute)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/orders/:orderId

REQUEST BODY

OrderInput object

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to ordersChanged
data OrdersChanged OR ErrorResponse

Replace Orders

curl -H "Content-Type: application/json" -X PUT -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders?key=AUTH_KEY
PUT /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "orders": [
    {
      "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
      "name": "Order 6 - Replaced",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {
        "people": 6
      },
      "delivery": {
        "location": {
          "address": "2002 2nd Ave, Jasper, AL 35501, USA"
        },
        "timeWindows": [
          {
            "startSec": 43200,
            "endSec": 54000
          }
        ],
        "notes": "Order replaced via API",
        "serviceTimeSec": 900,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {
          "my custom field": "custom field content",
          "orderId": "abcd1234"
        }
      }
    },
    {
      "id": "17646990-e888-4e81-8d36-88976e1e3cfa",
      "name": "Order 1 - Replaced",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151205"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA"
        },
        "timeWindows": [
          {
            "startSec": 30600,
            "endSec": 37800
          }
        ],
        "notes": "removed one time window and restricted eligibility to one day",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    }
  ]

The above command returns JSON structured like this:

{
  "requestId": "95452e2e-e358-4472-b10e-6083a5174199"
}

And triggers an OrdersChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "95452e2e-e358-4472-b10e-6083a5174199",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [
      {
        "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "geocodeStatus": {
          "delivery": "OK"
        }
      },
      {
        "id": "17646990-e888-4e81-8d36-88976e1e3cfa",
        "geocodeStatus": {
          "delivery": "OK"
        }
      }
    ],
    "deleted": []
  }
}

Overwrite multiple Orders with new data (asynchronous).

If a replaced Order is part of a Route, Time Of Arrival information for that Route might change accordingly (e.g.: if the new data changes the service time or the address of the Order).

THROTTLING

Leaky bucket (size:10, refill: 10 per minute)

HTTP REQUEST

PUT https://wwrm.workwave.com/api/v1/territories/:territoryId/orders

REQUEST BODY

Property Type Description
orders list of Order List of replacement Orders

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to ordersChanged
data OrdersChanged OR ErrorResponse

Replace an OrderStep

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7/delivery?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7/delivery HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "location": {
    "address": "2007 2nd Ave, Jasper, AL 35501, USA"
  },
  "timeWindows": [
    {
      "startSec": 43200,
      "endSec": 54000
    }
  ],
  "notes": "Delivery OrderStep replaced via API",
  "serviceTimeSec": 1800,
  "tagsIn": [],
  "tagsOut": [],
  "customFields": {}
}

The above command returns JSON structured like this:

{
  "requestId": "408d680e-d404-4a81-9d49-da1fd74ec66f"
}

And triggers an OrdersChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "408d680e-d404-4a81-9d49-da1fd74ec66f",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [
      {
        "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "geocodeStatus": {
          "delivery": "OK"
        }
      }
    ],
    "deleted": []
  }
}

Overwrite an OrderStep with new data (asynchronous).

THROTTLING

Leaky bucket (size:60, refill: 20 per minute)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/orders/:orderId/:orderStepType

PATH PARAMETERS

Property Type Description
orderStepType enum Can be pickup or delivery

REQUEST BODY

OrderStepInput object

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to ordersChanged
data OrdersChanged OR ErrorResponse

Delete an Order

curl -X DELETE https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7?key=AUTH_KEY
DELETE /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{
  "requestId": "9c66f107-320f-4ae5-85f6-3dddaa7c8c8e"
}

And triggers an OrdersChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "9c66f107-320f-4ae5-85f6-3dddaa7c8c8e",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [],
    "deleted": [
      "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7"
    ]
  }
}

Delete an Order (asynchronous).

THROTTLING

Leaky bucket (size:20, refill: 20 per minute)

HTTP REQUEST

DELETE https://wwrm.workwave.com/api/v1/territories/:territoryId/orders/:orderId

RETURN VALUES (notification)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to ordersChanged
data OrdersChanged OR ErrorResponse

Delete Orders

curl -X DELETE https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders?key=AUTH_KEY&ids=fb5e269b-9a16-4d44-abe5-a3f1c84acdb7,a5682ad9-97e8-4719-9bb6-eecfcfb8606b
DELETE /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7?ids=fb5e269b-9a16-4d44-abe5-a3f1c84acdb7,a5682ad9-97e8-4719-9bb6-eecfcfb8606b HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{
  "requestId": "30427810-0672-4fd7-b56a-92698860a7f5"
}

And triggers an OrdersChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "30427810-0672-4fd7-b56a-92698860a7f5",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [],
    "deleted": [
      "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
      "a5682ad9-97e8-4719-9bb6-eecfcfb8606b"
    ]
  }
}

Delete multiple Orders (asynchronous).

THROTTLING

Leaky bucket (size:20, refill: 20 per minute)

HTTP REQUEST

DELETE https://wwrm.workwave.com/api/v1/territories/:territoryId/orders?ids=<comma_separated_list>

QUERYSTRING PARAMETERS

Property Type Description
ids comma-separated list of String Mandatory. If empty no Order is deleted

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to ordersChanged
data OrdersChanged OR ErrorResponse

Delete an OrderStep

curl -X DELETE https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7/delivery?key=AUTH_KEY
DELETE /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/orders/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7/delivery HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{
  "requestId": "92c467fb-aa24-4f19-b934-18a3ebac0695"
}

And triggers an OrdersChanged Notification (POSTed to the callback URL) structured like this:

// If the removed OrderStep was the only OrderStep, the Order is deleted:
{
  "requestId": "92c467fb-aa24-4f19-b934-18a3ebac0695",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [],
    "deleted": [
      "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7"
    ]
  }
}
// If the Order had both pickup and delivery OrderSteps, removing one (say, the delivery) updates the Order:
{
  "requestId": "92c467fb-aa24-4f19-b934-18a3ebac0695",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [
      {
        "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "geocodeStatus": {
          "pickup": "OK"
        }
      }
    ],
    "deleted": []
  }
}

Delete an OrderStep (asynchronous).

If the OrderStep is the only one belonging to the Order, the Order itself is deleted.

THROTTLING

Leaky bucket (size:20, refill: 20 per minute)

HTTP REQUEST

DELETE https://wwrm.workwave.com/api/v1/territories/:territoryId/orders/:orderId/:orderStepType

PATH PARAMETERS

Property Type Description
orderStepType enum Can be pickup or delivery

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to ordersChanged
data OrdersChanged OR ErrorResponse

Time Of Arrival API

List Current Routes

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/toa/routes?key=AUTH_KEY&date=20151112
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/toa/routes HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "routes": {
    "0d8855e6-28a0-4e89-9c67-b44c66c39ba6-20151204": {
      "id": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6-20151204",
      "revision": 182,
      "date": "20151204",
      "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
      "steps": [
        {
          "type": "departure",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 0,
          "startSec": 0,
          "endSec": 32329,
          "driveToNextSec": -1,
          "distanceToNextMt": -1,
          "displayLabel": ""
        },
        {
          "type": "delivery",
          "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 34200,
          "startSec": 34200,
          "endSec": 36000,
          "driveToNextSec": -1,
          "distanceToNextMt": -1,
          "displayLabel": "1.1",
          "trackingData": {
            "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
            "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
            "timeInSec": 34526,
            "timeInLatLng": [
              33817872,
              -87266893
            ],
            "timeOutSec": -1,
            "timeOutLatLng": null,
            "status": "done",
            "statusSec": 35912,
            "statusLatLng": [
              33817872,
              -87266893
            ],
            "timeInDetectedSec": 34201,
            "timeInDetectedLatLng": [
              33817942,
              -87266921
            ],
            "timeOutDetectedSec": 35935,
            "timeOutDetectedLatLng": [
              33817404,
              -87266657
            ]
          }
        },
        {
          "type": "pickup",
          "orderId": "0dd9cab0-d1db-45de-b291-31a0b66d5562",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 39600,
          "startSec": 39600,
          "endSec": 40600,
          "driveToNextSec": -1,
          "distanceToNextMt": -1,
          "displayLabel": "1.2",
          "trackingData": {
            "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
            "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
            "timeInSec": 39600,
            "timeInLatLng": [
              33480873,
              -86788220
            ],
            "timeOutSec": 40720,
            "timeOutLatLng": [
              33480873,
              -86788220
            ],
            "status": "done",
            "statusSec": 40780,
            "statusLatLng": [
              33480873,
              -86788220
            ],
            "timeInDetectedSec": 39582,
            "timeInDetectedLatLng": [
              33481223,
              -86787985
            ],
            "timeOutDetectedSec": 40795,
            "timeOutDetectedLatLng": [
              33481223,
              -86788790
            ]
          }
        }
      ]
    },
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
      "revision": 113,
      "date": "20151203",
      "vehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "driverId": "a3935987-4944-462f-b602-4a3a12beeeff",
      "steps": [
        {
          "type": "departure",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 0,
          "startSec": 0,
          "endSec": 28800,
          "driveToNextSec": 2918,
          "distanceToNextMt": 73402,
          "displayLabel": ""
        },
        {
          "type": "pickup",
          "orderId": "e2524914-3611-433b-9209-3ee59ee3996e",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 31718,
          "startSec": 31718,
          "endSec": 32318,
          "driveToNextSec": 2917,
          "distanceToNextMt": 73549,
          "displayLabel": "2.1"
        },
        {
          "type": "delivery",
          "orderId": "deb5a845-40f8-42e0-963e-9646531894a4",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 28848,
          "startSec": 28848,
          "endSec": 29748,
          "driveToNextSec": 48,
          "distanceToNextMt": 334,
          "displayLabel": "2.2"
        }
      ]
    }
  },
  "orders": {
    "49269a16-479c-4531-8ffd-513b7ccd0621": {
      "id": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "name": "Order 1",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204",
          "20151205",
          "20151206"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA",
          "latLng": [
            33817872,
            -87266893
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 30600,
            "endSec": 37800
          },
          {
            "startSec": 45000,
            "endSec": 55800
          }
        ],
        "notes": "demonstrate the concept of multiple time windows as well as eligibility date range",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    },
    "0dd9cab0-d1db-45de-b291-31a0b66d5562": {
      "id": "0dd9cab0-d1db-45de-b291-31a0b66d5562",
      "name": "Order 4",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {
        "frozen ton": 100,
        "regular ton": 300
      },
      "pickup": {
        "depotId": null,
        "location": {
          "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
          "latLng": [
            33480873,
            -86788220
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "demonstrate the concept of loads. Furthermore this Order involves both a Pickup and a Delivery(meaning that the Vehicle servicing it will pick up loads at one location and delivered them at a different location)",
        "serviceTimeSec": 0,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": {
        "depotId": null,
        "location": {
          "address": "1411 Indiana Ave, Jasper, AL 35501, USA",
          "latLng": [
            33836824,
            -87266029
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 46800,
            "endSec": 52200
          },
          {
            "startSec": 55800,
            "endSec": 59400
          }
        ],
        "notes": "Fragile",
        "serviceTimeSec": 1500,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {
          "Building Entrance Code": "0000"
        }
      },
      "isService": false
    },
    "e2524914-3611-433b-9209-3ee59ee3996e": {
      "id": "e2524914-3611-433b-9209-3ee59ee3996e",
      "name": "Order 6",
      "eligibility": {
        "type": "any",
        "onDates": [
          "20151203"
        ]
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {
        "people": 400
      },
      "pickup": {
        "depotId": null,
        "location": {
          "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
          "latLng": [
            33480873,
            -86788220
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of force a vehicle, apply different eligibility type",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": null,
      "isService": false
    },
    "deb5a845-40f8-42e0-963e-9646531894a4": {
      "id": "deb5a845-40f8-42e0-963e-9646531894a4",
      "name": "order2",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151205"
        ]
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "33.833605,-87.277556",
          "latLng": [
            33833604,
            -87277556
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "",
        "serviceTimeSec": 900,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    }
  },
  "vehicles": {
    "0d8855e6-28a0-4e89-9c67-b44c66c39ba6": {
      "id": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "idx": 1,
      "externalId": "Vehicle 1",
      "tracked": true,
      "color": "009944",
      "settings": {
        "20151203": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "frozen ton": 500,
            "regular ton": 500
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "frozen",
            "regular"
          ],
          "speedFactor": 100
        },
        "20151204": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "frozen ton": 500,
            "regular ton": 500
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "frozen",
            "regular"
          ],
          "speedFactor": 100
        }
      }
    },
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "idx": 2,
      "externalId": "Vehicle 2",
      "tracked": true,
      "color": "5500FF",
      "settings": {
        "20151203": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        },
        "20151204": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        },
        "20151205": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        }
      }
    }
  },
  "depots": {
    "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
      "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
      "name": "TEST",
      "setupCost": -1,
      "setupTimeSec": -1,
      "location": {
        "address": "320 20th St W, Jasper, AL 35501, USA",
        "latLng": [
          33831316,
          -87278355
        ],
        "status": "OK"
      },
      "color": "998800"
    }
  },
  "drivers": {
    "a08213e6-673f-4efc-955e-2bf587813162": {
      "id": "a08213e6-673f-4efc-955e-2bf587813162",
      "name": "Driver 2",
      "email": "driver2@example.com"
    },
    "a3935987-4944-462f-b602-4a3a12beeeff": {
      "id": "a3935987-4944-462f-b602-4a3a12beeeff",
      "name": "Driver 1",
      "email": "driver1@example.com"
    }
  }
}

List current, live Routes, optionally filtering by date and/or vehicleId (synchronous). Route objects contain a sequence of steps that include time-of-arrival data in the form of ETAs (for steps referencing Orders yet to be visited) or Execution Events (as received by the Mobile Application).

THROTTLING

Rate-limit (1 call every 20 seconds)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/toa/routes[?date=<yyyyMMdd>&vehicle=<vehicleId>]

QUERYSTRING PARAMETERS

Property Type Description
date DateString Optional. If not specified all current (not yet archived) Routes are returned
vehicle UUID Optional. If specified only Routes for the specified Vehicle are returned

RETURN VALUES

Property Type Description
routes map[String] Route A map where the key is the routeId and the value is the associated Route object
drivers map[String] Driver A map where the key is the driverId and the value is the associated Driver object. Includes Drivers referenced by the listed Routes (if any)
vehicles map[String] VehicleFull A map where the key is the vehicleId and the value is the associated Vehicle object. Includes Vehicles referenced by the listed Routes
orders map[String] Order A map where the key is the orderId and the value is the associated Order object. Includes Orders referenced by the listed Routes
depots map[String] Depot A map where the key is the depotId and the value is the associated Depot object. Includes Depots referenced by the listed Orders and Vehicles

Get Current Route

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/toa/routes?key=AUTH_KEY&date=20151203
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/toa/routes HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "routes": {
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
      "revision": 113,
      "date": "20151203",
      "vehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "driverId": "a3935987-4944-462f-b602-4a3a12beeeff",
      "steps": [
        {
          "type": "departure",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 0,
          "startSec": 0,
          "endSec": 28800,
          "driveToNextSec": 2918,
          "distanceToNextMt": 73402,
          "displayLabel": ""
        },
        {
          "type": "pickup",
          "orderId": "e2524914-3611-433b-9209-3ee59ee3996e",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 31718,
          "startSec": 31718,
          "endSec": 32318,
          "driveToNextSec": 2917,
          "distanceToNextMt": 73549,
          "displayLabel": "2.1"
        },
        {
          "type": "delivery",
          "orderId": "deb5a845-40f8-42e0-963e-9646531894a4",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 35235,
          "startSec": 35235,
          "endSec": 36135,
          "driveToNextSec": 48,
          "distanceToNextMt": 334,
          "displayLabel": "2.2"
        },
        {
          "type": "arrival",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 36183,
          "startSec": 36183,
          "endSec": 36183,
          "driveToNextSec": 0,
          "distanceToNextMt": 0,
          "displayLabel": ""
        }
      ]
    }
  },
  "orders": {
    "e2524914-3611-433b-9209-3ee59ee3996e": {
      "id": "e2524914-3611-433b-9209-3ee59ee3996e",
      "name": "Order 6",
      "eligibility": {
        "type": "any",
        "onDates": [
          "20151203"
        ]
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {
        "people": 400
      },
      "pickup": {
        "depotId": null,
        "location": {
          "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
          "latLng": [
            33480873,
            -86788220
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of force a vehicle, apply different eligibility type",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": null,
      "isService": false
    },
    "deb5a845-40f8-42e0-963e-9646531894a4": {
      "id": "deb5a845-40f8-42e0-963e-9646531894a4",
      "name": "order2",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151205"
        ]
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "33.833605,-87.277556",
          "latLng": [
            33833604,
            -87277556
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "",
        "serviceTimeSec": 900,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    }
  },
  "vehicles": {
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "idx": 2,
      "externalId": "Vehicle 2",
      "tracked": true,
      "color": "5500FF",
      "settings": {
        "20151203": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        },
        "20151204": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        },
        "20151205": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        }
      }
    }
  },
  "depots": {
    "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
      "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
      "name": "TEST",
      "setupCost": -1,
      "setupTimeSec": -1,
      "location": {
        "address": "320 20th St W, Jasper, AL 35501, USA",
        "latLng": [
          33831316,
          -87278355
        ],
        "status": "OK"
      },
      "color": "998800"
    }
  },
  "drivers": {
    "a3935987-4944-462f-b602-4a3a12beeeff": {
      "id": "a3935987-4944-462f-b602-4a3a12beeeff",
      "name": "Driver 1",
      "email": "driver1@example.com"
    }
  }
}

Get a current Route (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 6 per minute)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/toa/routes/:routeId

RETURN VALUES

Property Type Description
routes map[String] Route A map where the key is the routeId and the value is the associated Route object
drivers map[String] Driver A map where the key is the driverId and the value is the associated Driver object. Includes Drivers referenced by the listed Routes (if any)
vehicles map[String] VehicleFull A map where the key is the vehicleId and the value is the associated Vehicle object. Includes Vehicles referenced by the listed Routes
orders map[String] Order A map where the key is the orderId and the value is the associated Order object. Includes Orders referenced by the listed Routes
depots map[String] Depot A map where the key is the depotId and the value is the associated Depot object. Includes Depots referenced by the listed Orders and Vehicles

Send Execution Events

Example #1: send time-in, time-out and status events

curl -H "Content-Type: application/json" -X POST -d 'request body #1' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/toa/executionevents?key=AUTH_KEY
POST /territories/429defc8-5b05-4c3e-920d-0bb911a61345/toa/executionevents HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

{
  "events": [
    {
      "type": "timeIn",
      "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "orderStepType": "delivery",
      "date": "20151204",
      "data": {
        "sec": 35132
      }
    },
    {
      "type": "timeOut",
      "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "orderStepType": "delivery",
      "date": "20151204",
      "data": {
        "sec": 36875
      }
    },
    {
      "type": "statusUpdate",
      "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "orderStepType": "delivery",
      "date": "20151204",
      "data": {
        "sec": 36863,
        "status": "done"
      }
    }
  ]
}

The above command returns JSON structured like this:

{
  "requestId": "a6f01d6b-a085-4812-8784-48d26d888809"
}

And triggers an ExecutionEventsProcessed Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "a6f01d6b-a085-4812-8784-48d26d888809",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "executionEventsProcessed",
  "data": {
    "processed": [
      "OK",
      "OK",
      "OK"
    ]
  }
}

Example #2: send proof-of-delivery events

curl -H "Content-Type: application/json" -X POST -d 'request body #2' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/toa/executionevents?key=AUTH_KEY
POST /territories/429defc8-5b05-4c3e-920d-0bb911a61345/toa/executionevents HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

{
  "events": [
    {
      "type": "note",
      "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "orderStepType": "delivery",
      "date": "20151112",
      "data": {
        "sec": 35203,
        "text": "Best parking spot is 50mt ahead"
      }
    },
    {
      "type": "picture",
      "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "orderStepType": "delivery",
      "date": "20151112",
      "data": {
        "id": "picture-1",
        "sec": 35427,
        "text": "Minor damage in lower left corner",
        "mime": "image/png",
        "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mNgYmICAAAQAAei1PI/AAAAAElFTkSuQmCC"
      }
    },
    {
      "type": "signature",
      "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "orderStepType": "delivery",
      "date": "20151112",
      "data": {
        "id": "customer",
        "sec": 36813,
        "text": "John Black",
        "mime": "image/png",
        "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mNgYmICAAAQAAei1PI/AAAAAElFTkSuQmCC"
      }
    }
  ]
}

The above command returns JSON structured like this:

{
  "requestId": "303d5b11-23a1-4501-a49c-f26ec2c50094"
}

And triggers an ExecutionEventsProcessed Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "303d5b11-23a1-4501-a49c-f26ec2c50094",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "executionEventsProcessed",
  "data": {
    "processed": [
      "OK",
      "OK",
      "OK"
    ]
  }
}

An Execution Event can be:

An execution event, when processed, causes ETAs of yet-to-be-serviced Orders to be updated.

If time-in data is available but time-out data is not, the time-out time is considered to be the time-in data + the Order’s expected serviceTime. Conversely if time-out data is available but time-in data is not, the time-in time is considered to be the time-out data - the Order’s expected serviceTime.

If both time-in and time-out data is not available but a status-update is present, the time of the status-update is considered as a time-out.

If time-in, time-out and status-update are not available and a proof-of-delivery event is sent, a time-out event is implicitly created at the time and location reported by the proof-of-delivery event.

Note: by default detected time-ins and time-outs do not trigger ETA updates. This behavior can be altered on a per-territory basis. Please contact our support team for more information about this topic.

THROTTLING

Leaky bucket (size:40, refill: 20 per minute)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/toa/executionevents

REQUEST BODY

Property Type Description
events list of ExecutionEvent List of ExecutionEvents to be processed

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to executionEventsProcessed
data ExecutionEventsProcessed OR ErrorResponse

Download a Proof of Delivery item

curl https://wwrm.workwave.com/api/v1/pod/20151204-429defc8-ddaa51ee.png?key=AUTH_KEY
GET /pod/20151204-429defc8-ddaa51ee.png HTTP/1.0
Accept: image/png
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

Download a Proof of Delivery item: image or audio recording (synchronous).

THROTTLING

Leaky bucket (size:5, refill: 1 per second)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/pod/:token

QUERYSTRING PARAMETERS

Property Type Description
token String The Proof Of Delivery token provided by Pod objects returned by either “List Current Routes” or “Get Current Route” API requests

RETURN VALUES

(proof of delivery binary data. mime-type available in the content-type header)

Approved Plans API

List Approved Routes

curl https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/approved/routes?key=AUTH_KEY&date=20151204
GET /territories/429defc8-5b05-4c3e-920d-0bb911a61345/approved/routes HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{
  "routes": {
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151204": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151204",
      "revision": 166,
      "date": "20151204",
      "vehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "driverId": "a3935987-4944-462f-b602-4a3a12beeeff",
      "steps": [
        {
          "type": "departure",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 0,
          "startSec": 0,
          "endSec": 28800,
          "driveToNextSec": 2918,
          "distanceToNextMt": 73402,
          "displayLabel": ""
        },
        {
          "type": "pickup",
          "orderId": "1066ecd2-8171-4daf-a8f3-9bf302a2a38f",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 31718,
          "startSec": 31718,
          "endSec": 32318,
          "driveToNextSec": 2917,
          "distanceToNextMt": 73549,
          "displayLabel": "2.1"
        },
        {
          "type": "arrival",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 35235,
          "startSec": 35235,
          "endSec": 35235,
          "driveToNextSec": 0,
          "distanceToNextMt": 0,
          "displayLabel": ""
        }
      ]
    },
    "0d8855e6-28a0-4e89-9c67-b44c66c39ba6-20151204": {
      "id": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6-20151204",
      "revision": 166,
      "date": "20151204",
      "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
      "steps": [
        {
          "type": "departure",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 0,
          "startSec": 0,
          "endSec": 32329,
          "driveToNextSec": 360,
          "distanceToNextMt": 2424,
          "displayLabel": ""
        },
        {
          "type": "delivery",
          "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 32689,
          "startSec": 32689,
          "endSec": 33289,
          "driveToNextSec": 3232,
          "distanceToNextMt": 72814,
          "displayLabel": "1.1"
        },
        {
          "type": "delivery",
          "orderId": "65413bab-aea8-41af-8992-487a32f50a59",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 44231,
          "startSec": 44231,
          "endSec": 46031,
          "driveToNextSec": 769,
          "distanceToNextMt": 5955,
          "displayLabel": "1.6"
        },
        {
          "type": "arrival",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 48480,
          "startSec": 48480,
          "endSec": 48480,
          "driveToNextSec": 0,
          "distanceToNextMt": 0,
          "displayLabel": ""
        }
      ]
    }
  },
  "orders": {
    "1066ecd2-8171-4daf-a8f3-9bf302a2a38f": {
      "id": "1066ecd2-8171-4daf-a8f3-9bf302a2a38f",
      "name": "Order 6",
      "eligibility": {
        "type": "any"
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {
        "people": 400
      },
      "pickup": {
        "depotId": null,
        "location": {
          "address": "",
          "latLng": [
            33480873,
            -86788220
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of force a vehicle, apply different eligibility type",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": null,
      "isService": false
    },
    "65413bab-aea8-41af-8992-487a32f50a59": {
      "id": "65413bab-aea8-41af-8992-487a32f50a59",
      "name": "Order 7",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "1300 S Skyline Dr, Jasper, AL 35501, USA",
          "latLng": [
            33843834,
            -87315561
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of tags in/out",
        "serviceTimeSec": 1800,
        "tagsIn": [
          "frozen",
          "regular"
        ],
        "tagsOut": [
          "heavy"
        ],
        "customFields": {}
      },
      "isService": false
    },
    "49269a16-479c-4531-8ffd-513b7ccd0621": {
      "id": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "name": "Order 1",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151204",
          "20151205",
          "20151206"
        ]
      },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA",
          "latLng": [
            33817872,
            -87266893
          ],
          "status": "OK"
        },
        "timeWindows": [
          {
            "startSec": 30600,
            "endSec": 37800
          },
          {
            "startSec": 45000,
            "endSec": 55800
          }
        ],
        "notes": "demonstrate the concept of multiple time windows as well as eligibility date range",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    }
  },
  "vehicles": {
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "idx": 2,
      "externalId": "Vehicle 2",
      "tracked": true,
      "color": "5500FF",
      "settings": {
        "20151204": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        }
      }
    },
    "0d8855e6-28a0-4e89-9c67-b44c66c39ba6": {
      "id": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
      "idx": 1,
      "externalId": "Vehicle 1",
      "tracked": true,
      "color": "009944",
      "settings": {
        "20151204": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "frozen ton": 500,
            "regular ton": 500
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "frozen",
            "regular"
          ],
          "speedFactor": 100
        }
      }
    }
  },
  "depots": {
    "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
      "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
      "name": "TEST",
      "setupCost": -1,
      "setupTimeSec": -1,
      "location": {
        "address": "320 20th St W, Jasper, AL 35501, USA",
        "latLng": [
          33831316,
          -87278355
        ],
        "status": "OK"
      },
      "color": "998800"
    }
  },
  "drivers": {
    "a08213e6-673f-4efc-955e-2bf587813162": {
      "id": "a08213e6-673f-4efc-955e-2bf587813162",
      "name": "Driver 2",
      "email": "driver2@example.com"
    },
    "a3935987-4944-462f-b602-4a3a12beeeff": {
      "id": "a3935987-4944-462f-b602-4a3a12beeeff",
      "name": "Driver 1",
      "email": "driver1@example.com"
    }
  }
}

List approved planned Routes (synchronous). Approved Routes define the plan as it was “frozen” right before being dispatched for execution, therefore they only contain ETAs.

THROTTLING

Rate-limit (1 call every minute)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/approved/routes[?date=today|<yyyyMMdd>]

QUERYSTRING PARAMETERS

Property Type Description
date DateString OR “today” Get all Approved Routes for the given date (defaults to “today”)

RETURN VALUES

Property Type Description
routes map[String] Route A map where the key is the routeId and the value is the associated Route object
drivers map[String] Driver A map where the key is the driverId and the value is the associated Driver object. Includes Drivers referenced by the listed Routes (if any)
vehicles map[String] VehicleFull A map where the key is the vehicleId and the value is the associated Vehicle object. Includes Vehicles referenced by the listed Routes
orders map[String] Order A map where the key is the orderId and the value is the associated Order object. Includes Orders referenced by the listed Routes
depots map[String] Depot A map where the key is the depotId and the value is the associated Depot object. Includes Depots referenced by the listed Orders and Vehicles

Get Approved Route

Get an approved planned Route (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 6 per minute)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/approved/routes/:routeId

RETURN VALUES

Property Type Description
routes map[String] Route A map where the key is the routeId and the value is the associated Route object
drivers map[String] Driver A map where the key is the driverId and the value is the associated Driver object. Includes Drivers referenced by the listed Routes (if any)
vehicles map[String] VehicleFull A map where the key is the vehicleId and the value is the associated Vehicle object. Includes Vehicles referenced by the listed Routes
orders map[String] Order A map where the key is the orderId and the value is the associated Order object. Includes Orders referenced by the listed Routes
depots map[String] Depot A map where the key is the depotId and the value is the associated Depot object. Includes Depots referenced by the listed Orders and Vehicles

Approve Routes

curl -H "Content-Type: application/json" -X POST https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/approved/20151204?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/approved/20151204 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "requestId": "cf65a452-68be-4ffa-a8e6-25a2b80466b4"
}

And triggers an ApprovedRoutesChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "cf65a452-68be-4ffa-a8e6-25a2b80466b4",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "approvedRoutesChanged",
  "data": {
    "approved": ["20151204"],
    "revoked": []
  }
}

Approve (or update approval of) all Routes for the given date (asynchronous).

Approving Routes:

THROTTLING

Leaky bucket (size:3, refill: 1 per minute)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/approved/:date

QUERYSTRING PARAMETERS

Property Type Description
date DateString The date where Routes must be approved

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to approvedRoutesChanged
data ApprovedRoutesChanged OR ErrorResponse The list of dates where Routes have been approved, or where approval has been updated

Revoke Routes

curl -H "Content-Type: application/json" -X DELETE https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/approved/20151205?key=AUTH_KEY
DELETE /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/approved/20151205 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "requestId": "30eef241-ca63-4d6f-94a2-97352a7a1393"
}

And triggers an ApprovedRoutesChanged Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "30eef241-ca63-4d6f-94a2-97352a7a1393",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "approvedRoutesChanged",
  "data": {
    "revoked": ["20151205"]
  }
}

Revoke approval for all Routes for the given date (asynchronous).

THROTTLING

Leaky bucket (size:3, refill: 1 per minute)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/approved/:date

QUERYSTRING PARAMETERS

Property Type Description
date DateString The date where Routes must be revoked approval

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to approvedRoutesChanged
data ApprovedRoutesChanged OR ErrorResponse The list of dates where Routes have been revoked approval

Scheduling API

Build Routes

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/scheduling/buildroutes?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/scheduling/buildroutes HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "from": "20151204",
  "to": "20151207"
}

The above command returns JSON structured like this:

{
  "requestId": "ea261eca-59b1-4151-8883-4b504d43241a"
}

And triggers an SchedulingCompleted Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "ea261eca-59b1-4151-8883-4b504d43241a",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {}
}

(Re)build Routes with the goal of serving all Orders eligible in the given date-range minimizing the overall cost (asynchronous).

The behavior is equivalent to expanding the “Build Routes” dropdown button from within the WorkWave Route Manager Web Application and selecting the “Full Optimization” option.

THROTTLING

Rate-limit (1 call every 1 minute)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/scheduling/buildroutes

REQUEST BODY

Property Type Description
from DateString Inclusive
to DateString Inclusive. Must be >= from. Must not exceed the allowed optimization horizon.
lockedRouteIdsOverride list of String Optional list of routeIds. Defaults to null.
If null UI-defined locks are honored.
If not null UI-defined locks are ignored and replaced with those from this list. The scope of the override is limited to the request (UI-defined locks are left unchanged)

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to schedulingCompleted
data SchedulingCompleted OR ErrorResponse

Fit-In Unassigned Orders

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/scheduling/fitin?key=AUTH_KEY
POST /territories/429defc8-5b05-4c3e-920d-0bb911a61345/scheduling/fitin HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "from": "20151204",
  "to": "20151204",
  "orderIds": ["603a348f-7fcc-4bdc-8f4a-ec10a68547e0"]
}

The above command returns JSON structured like this:

{
  "requestId": "3dad8065-2c06-44ce-a4d8-c8a079b895a6"
}

And triggers an SchedulingCompleted Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "3dad8065-2c06-44ce-a4d8-c8a079b895a6",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {
    "orderIds": ["603a348f-7fcc-4bdc-8f4a-ec10a68547e0"]
  }
}

Fit unassigned Orders into Routes in the given date-range minimizing the overall cost and preserving existing Vehicle-Route assignments (asynchronous).

The behavior is equivalent to expanding the “Build Routes” dropdown button from within the WorkWave Route Manager Web Application and selecting the “Fit In unassigned Orders” option.

If Orders cannot be fit into existing routes but unused Vehicles are available, they will be used.

THROTTLING

Rate-limit (1 call every 20 seconds)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/scheduling/fitin

REQUEST BODY

Property Type Description
from DateString Inclusive
to DateString Inclusive. Must be >= from. Must not exceed the allowed optimization horizon
orderIds list of String Optional. Ids of eligible, unassigned Orders that should be fitted in. If null or empty the system will try to fit-in all unassigned Orders that are eligible in the given date range
routeIds list of String Optional. If provided, the system tries to fit Orders only in the given Routes. If null or empty the system will try to fit Orders in any available Route (existing or new) matching the given from/to date range. If specified overrides from/to preperties.
overrideLockedRoutes boolean Optional. Defaults to false.
If set to false UI-defined locks are honored.
If set to true UI-defined locks are ignored (i.e.: all Routes and Vehicles matched by the date range and by routeIds become eligible targets for fitting in unassigned Orders regardless of UI-defined locks)

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to schedulingCompleted
data SchedulingCompleted OR ErrorResponse

Unassign Orders

curl -H "Content-Type: application/json" -X POST https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/scheduling/unassign?key=AUTH_KEY&orderIds=603a348f-7fcc-4bdc-8f4a-ec10a68547e0
POST /territories/429defc8-5b05-4c3e-920d-0bb911a61345/territories/429defc8-5b05-4c3e-920d-0bb911a61345/scheduling/unassign?orderIds=603a348f-7fcc-4bdc-8f4a-ec10a68547e0 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "requestId": "ea261eca-59b1-4151-8883-4b504d43241a"
}

And triggers an SchedulingCompleted Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "ea261eca-59b1-4151-8883-4b504d43241a",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {
    "orderIds": [
      "603a348f-7fcc-4bdc-8f4a-ec10a68547e0"
    ]
  }
}

Unassign Orders from their current routes, clearing their tracking data (asynchronous).

THROTTLING

Rate-limit (1 call every 20 seconds)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/scheduling/unassign?orderIds=<comma_separated_list>

QUERYSTRING PARAMETERS

Property Type Description
orderIds comma-separated list of String Mandatory. List of one or more Orders to unassign

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to schedulingCompleted
data SchedulingCompleted OR ErrorResponse

Assign an OrderStep

curl -X POST https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/scheduling/assign/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7/delivery/to/31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151204/after/20342?key=AUTH_KEY
POST /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/scheduling/assign/fb5e269b-9a16-4d44-abe5-a3f1c84acdb7/delivery/to/31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151204/after/20342 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{
  "requestId": "ebc076b0-18ba-40d6-963a-288d0cc1e33f"
}

And, if the OrderStep is successfully (re)assigned, triggers an SchedulingCompleted Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "ebc076b0-18ba-40d6-963a-288d0cc1e33f",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {
    "orderSteps": [
      {
        "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "type": "delivery"
      }
    ]
  }
}

Or, if the OrderStep could not be (re)assigned, like this:

{
  "requestId": "ebc076b0-18ba-40d6-963a-288d0cc1e33f",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {
    "orderSteps": [
    ]
  }
}

Assign an OrderStep from its current Route (if any) and position to a new (or same) Route and position, updating ETAs accordingly (asynchronous).

If the OrderStep was previously assigned to a different Route, ETAs for both involved Routes are updated.

Note: It is not allowed to assign an OrderStep to a position that is in the past, i.e.: before the maximum time recorded by any one of the Execution Events associated to OrderSteps assigned to the target Route.

THROTTLING

Leaky bucket (size:20, refill: 1 per second)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/scheduling/assign/:orderId/:orderStepType/to/:routeId/after/:sec

PATH PARAMETERS

Property Type Description
orderStepType enum Can be pickup or delivery
routeId String Identifies the target Route. A target Route is created if it does not already exist.
sec int The time, in seconds since midnight, after which the OrderStep should be positioned. Set it to 0 to assign the OrderStep at the beginning of the Route.
Note: The system uses the provided time to figure out where, in the current sequence, the OrderStep needs to be inserted, and then reschedules the target Route adjusting ETAs to take into account driving times, time windows, etc…, therefore the actual time where the OrderStep is scheduled might end up being different.

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification)

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to schedulingCompleted
data SchedulingCompleted OR ErrorResponse

Proposals API

Compute ProposalsSet

curl -H "Content-Type: application/json" -X POST -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals?key=AUTH_KEY
POST /territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
  "order":
  {
    "name": "Order coming from Proposals API",
    "loads": {
      "pounds": 400
    },
    "delivery": {
      "location": {
        "address": "2001 2nd Ave, Jasper, AL 35501, USA"
      },
      "notes": "Order for which we want to compute a set of proposals",
      "serviceTimeSec": 1800,
      "customFields": {
        "my custom field": "custom field content",
        "orderId": "abcd1234"
      }
    },
    "isService": false
  },
  "timeSlots": [
    {
      "timeWindows": [
        {
          "startSec": 19800,
          "endSec": 21600
        }
      ],
      "date": "20151204"
    },
    {
      "timeWindows": [
        {
          "startSec": 46800,
          "endSec": 50400
        }
      ],
      "date": "20151204"
    },
    {
      "timeWindows": [
        {
          "startSec": 19800,
          "endSec": 21600
        }
      ],
      "date": "20151205"
    }
  ],
  "targetOrderStepType": "delivery",
  "overrideLockedRoutes": true
}

The above command returns JSON structured like this:

{
  "requestId": "f59d7e47-d67b-41a6-9cd4-fca9d481dec0"
}

And triggers a ProposalsSetProcessed Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "f59d7e47-d67b-41a6-9cd4-fca9d481dec0",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "proposalsSetProcessed",
  "data": {
    "order": {
      "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
      "geocodeStatus": {
        "delivery": "OK"
      }
    },
    "proposals": [
      {
        "status": "NOT_FOUND"
      },
      {
        "status": "FOUND",
        "routeId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
        "startSec": 38265
      },
      {
        "status": "NOT_FOUND"
      }
    ]
  }
}

Given an Order and a set of desired time slots, computes, for each slot, a “proposal” identifying the best Route that the Order can be assigned to in that slot (asynchronous).

Because of resource saturation or other constraints it may happen that, for some slots, the Order cannot be assigned to any Route. In that case the computed set of proposals will include “empty” proposals.

Once computed, the “set of proposals” is temporarily stored allowing for proposals in the set to be reviewed and, possibly, for one of them to be selected and applied.

THROTTLING

Concurrency-limit (max 3 concurrent computations)
Quantity-limit (max 10 stored results)

HTTP REQUEST

POST https://wwrm.workwave.com/api/v1/territories/:territoryId/experimental/proposals

REQUEST BODY

Property Type Description
order OrderInput Order for which we want to compute a set of proposals. The system will assign a UUID to the Order and return it in the proposalsSetProcessed notification message, in the order.id field.
Note: the Order is only added to the plan when one of the computed proposals is applied.
Note: timeWindows, timeWindowsExceptions and eligibility fields are ignored (see timeSlots below).
timeSlots list of TimeSlot Alternative time-slots applied to the Order’s TimeWindow and Eligibility properties to compute possible assignments
LIMITS: cannot contain more than 7 TimeSlots; each TimeSlot date must not match with any date of approved plans.
targetOrderStepType enum One of pickup or delivery.
Optional in case order defines just one OrderStep: either pickup or delivery.
Mandatory if order defines both pickup and delivery, as it identifies the target OrderStep to which timeSlots are applied to compute proposals.
overrideLockedRoutes boolean Optional. Defaults to false.
If set to false UI-defined locks are honored.
If set to true UI-defined locks are ignored (i.e.: all Routes and Vehicles are valid candidates)

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification).
Also used to identify the ProposalsSet object generated as a result of the computation.

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to proposalsSetProcessed
data ProposalsSetProcessed OR ErrorResponse

Get ProposalsSet

curl -X GET https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals/f59d7e47-d67b-41a6-9cd4-fca9d481dec0?key=AUTH_KEY
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals/f59d7e47-d67b-41a6-9cd4-fca9d481dec0 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{
  "requestId": "f59d7e47-d67b-41a6-9cd4-fca9d481dec0",
  "requestStatus": "COMPLETED",
  "expiryTs": 1423047900,
  "order": {
    "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
    "name": "Order 6 - Proposal",
    "eligibility": {
      "type": "any"
    },
    "forceVehicleId": null,
    "priority": 0,
    "loads": {
      "people": 2
    },
    "delivery": {
      "location": {
        "address": "2001 2nd Ave, Jasper, AL 35501, USA"
      },
      "timeWindows": [],
      "notes": "Proposal order to be added via API",
      "serviceTimeSec": 1800,
      "tagsIn": [],
      "tagsOut": [],
      "customFields": {
        "my custom field": "custom field content",
        "orderId": "abcd1234"
      }
    },
    "isService": false
  },
  "proposals": [
    {
      "status": "NOT_FOUND"
    },
    {
      "status": "FOUND",
      "data": {
        "routes": {
          "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203": {
            "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
            "revision": -1,
            "date": "20151204",
            "vehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
            "driverId": null,
            "steps": [
              {
                "type": "departure",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 0,
                "startSec": 0,
                "endSec": 28800,
                "driveToNextSec": 2918,
                "distanceToNextMt": 73402,
                "displayLabel": ""
              },
              {
                "type": "pickup",
                "orderId": "e2524914-3611-433b-9209-3ee59ee3996e",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 31718,
                "startSec": 31718,
                "endSec": 32318,
                "driveToNextSec": 2917,
                "distanceToNextMt": 73549,
                "displayLabel": ""
              },
              {
                "type": "delivery",
                "orderId": "deb5a845-40f8-42e0-963e-9646531894a4",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 35235,
                "startSec": 35235,
                "endSec": 36135,
                "driveToNextSec": 48,
                "distanceToNextMt": 334,
                "displayLabel": ""
              },
              {
                "type": "delivery",
                "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 38265,
                "startSec": 38265,
                "endSec": 40065,
                "driveToNextSec": 123,
                "distanceToNextMt": 846,
                "displayLabel": ""
              },
              {
                "type": "arrival",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 40188,
                "startSec": 40188,
                "endSec": 40188,
                "driveToNextSec": 0,
                "distanceToNextMt": 0,
                "displayLabel": ""
              }
            ]
          }
        },
        "orders": {
          "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7": {
            "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
            "name": "Order 6 - Proposal",
            "eligibility": {
              "on": "20151204"
            },
            "forceVehicleId": null,
            "priority": 0,
            "loads": {
              "people": 2
            },
            "delivery": {
              "location": {
                "address": "2001 2nd Ave, Jasper, AL 35501, USA"
              },
              "timeWindows": [
                {
                  "startSec": 46800,
                  "endSec": 50400
                }
              ],
              "notes": "Proposal order to be added via API",
              "serviceTimeSec": 1800,
              "tagsIn": [],
              "tagsOut": [],
              "customFields": {
                "my custom field": "custom field content",
                "orderId": "abcd1234"
              }
            },
            "isService": false
          },
          "e2524914-3611-433b-9209-3ee59ee3996e": {
            "id": "e2524914-3611-433b-9209-3ee59ee3996e",
            "name": "Order 6",
            "eligibility": {
              "type": "any",
              "onDates": [
                "20151203"
              ]
            },
            "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
            "priority": 0,
            "loads": {
              "people": 400
            },
            "pickup": {
              "depotId": null,
              "location": {
                "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
                "latLng": [
                  33480873,
                  -86788220
                ],
                "status": "OK"
              },
              "timeWindows": [],
              "notes": "Demonstrate the concept of force a vehicle, apply different eligibility type",
              "serviceTimeSec": 600,
              "tagsIn": [],
              "tagsOut": [],
              "customFields": {}
            },
            "delivery": null,
            "isService": false
          },
          "deb5a845-40f8-42e0-963e-9646531894a4": {
            "id": "deb5a845-40f8-42e0-963e-9646531894a4",
            "name": "order2",
            "eligibility": {
              "type": "on",
              "onDates": [
                "20151205"
              ]
            },
            "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
            "priority": 0,
            "loads": {},
            "pickup": null,
            "delivery": {
              "depotId": null,
              "location": {
                "address": "33.833605,-87.277556",
                "latLng": [
                  33833604,
                  -87277556
                ],
                "status": "OK"
              },
              "timeWindows": [],
              "notes": "",
              "serviceTimeSec": 900,
              "tagsIn": [],
              "tagsOut": [],
              "customFields": {}
            },
            "isService": false
          }
        },
        "vehicles": {
          "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
            "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
            "idx": 2,
            "externalId": "Vehicle 2",
            "tracked": true,
            "color": "5500FF",
            "settings": {
              "20151203": {
                "available": true,
                "notes": "",
                "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "timeWindow": {
                  "startSec": 28800,
                  "endSec": 61200
                },
                "flexStartTime": true,
                "perStopCost": 0,
                "perStopTimeSec": 0,
                "maxWorkingTimeSec": 0,
                "maxDrivingTimeSec": 0,
                "maxDistanceMt": 0,
                "breaks": [],
                "loadCapacities": {
                  "people": 600
                },
                "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                "activationCost": 0,
                "drivingTimeCost": 2000,
                "idleTimeCost": 2000,
                "serviceTimeCost": 2000,
                "breakTimeCost": 2000,
                "kmCost": 100,
                "tags": [
                  "heavy"
                ],
                "speedFactor": 100
              },
              "20151204": {
                "available": true,
                "notes": "",
                "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "timeWindow": {
                  "startSec": 28800,
                  "endSec": 61200
                },
                "flexStartTime": true,
                "perStopCost": 0,
                "perStopTimeSec": 0,
                "maxWorkingTimeSec": 0,
                "maxDrivingTimeSec": 0,
                "maxDistanceMt": 0,
                "breaks": [],
                "loadCapacities": {
                  "people": 600
                },
                "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                "activationCost": 0,
                "drivingTimeCost": 2000,
                "idleTimeCost": 2000,
                "serviceTimeCost": 2000,
                "breakTimeCost": 2000,
                "kmCost": 100,
                "tags": [
                  "heavy"
                ],
                "speedFactor": 100
              },
              "20151205": {
                "available": true,
                "notes": "",
                "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "timeWindow": {
                  "startSec": 28800,
                  "endSec": 61200
                },
                "flexStartTime": true,
                "perStopCost": 0,
                "perStopTimeSec": 0,
                "maxWorkingTimeSec": 0,
                "maxDrivingTimeSec": 0,
                "maxDistanceMt": 0,
                "breaks": [],
                "loadCapacities": {
                  "people": 600
                },
                "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                "activationCost": 0,
                "drivingTimeCost": 2000,
                "idleTimeCost": 2000,
                "serviceTimeCost": 2000,
                "breakTimeCost": 2000,
                "kmCost": 100,
                "tags": [
                  "heavy"
                ],
                "speedFactor": 100
              }
            }
          }
        },
        "depots": {
          "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
            "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
            "name": "TEST",
            "setupCost": -1,
            "setupTimeSec": -1,
            "location": {
              "address": "320 20th St W, Jasper, AL 35501, USA",
              "latLng": [
                33831316,
                -87278355
              ],
              "status": "OK"
            },
            "color": "998800"
          }
        },
        "drivers": {
          "a3935987-4944-462f-b602-4a3a12beeeff": {
            "id": "a3935987-4944-462f-b602-4a3a12beeeff",
            "name": "Driver 1",
            "email": "driver1@example.com"
          }
        }
      }
    },
    {
      "status": "NOT_FOUND"
    }
  ]
}

Retrieve the set of proposals identified by proposalsSetId (synchronous).

THROTTLING

Leaky bucket (size:20, refill: 1 per second)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/experimental/proposals/:proposalsSetId

RETURN VALUES (synchronous)

ProposalsSet

List ProposalsSets

curl -X GET https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals?key=AUTH_KEY
GET /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

[
    {
      "requestId": "f59d7e47-d67b-41a6-9cd4-fca9d481dec0",
      "requestStatus": "COMPLETED",
      "expiryTs": 1423047900,
      "order": {
        "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "name": "Order 6 - Proposal",
        "eligibility": {
          "type": "any"
        },
        "forceVehicleId": null,
        "priority": 0,
        "loads": {
          "people": 2
        },
        "delivery": {
          "location": {
            "address": "2001 2nd Ave, Jasper, AL 35501, USA"
          },
          "timeWindows": [],
          "notes": "Proposal order to be added via API",
          "serviceTimeSec": 1800,
          "tagsIn": [],
          "tagsOut": [],
          "customFields": {
            "my custom field": "custom field content",
            "orderId": "abcd1234"
          }
        },
        "isService": false
      },
      "proposals": [
        {
          "status": "NOT_FOUND"
        },
        {
          "status": "FOUND",
          "data": {
            "routes": {
              "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203": {
                "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
                "revision": -1,
                "date": "20151204",
                "vehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
                "driverId": null,
                "steps": [
                  {
                    "type": "departure",
                    "idleTimeSec": 0,
                    "perStopTimeSec": 0,
                    "arrivalSec": 0,
                    "startSec": 0,
                    "endSec": 28800,
                    "driveToNextSec": 2918,
                    "distanceToNextMt": 73402,
                    "displayLabel": ""
                  },
                  {
                    "type": "pickup",
                    "orderId": "e2524914-3611-433b-9209-3ee59ee3996e",
                    "idleTimeSec": 0,
                    "perStopTimeSec": 0,
                    "arrivalSec": 31718,
                    "startSec": 31718,
                    "endSec": 32318,
                    "driveToNextSec": 2917,
                    "distanceToNextMt": 73549,
                    "displayLabel": ""
                  },
                  {
                    "type": "delivery",
                    "orderId": "deb5a845-40f8-42e0-963e-9646531894a4",
                    "idleTimeSec": 0,
                    "perStopTimeSec": 0,
                    "arrivalSec": 35235,
                    "startSec": 35235,
                    "endSec": 36135,
                    "driveToNextSec": 48,
                    "distanceToNextMt": 334,
                    "displayLabel": ""
                  },
                  {
                    "type": "delivery",
                    "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
                    "idleTimeSec": 0,
                    "perStopTimeSec": 0,
                    "arrivalSec": 38265,
                    "startSec": 38265,
                    "endSec": 40065,
                    "driveToNextSec": 123,
                    "distanceToNextMt": 846,
                    "displayLabel": ""
                  },
                  {
                    "type": "arrival",
                    "idleTimeSec": 0,
                    "perStopTimeSec": 0,
                    "arrivalSec": 40188,
                    "startSec": 40188,
                    "endSec": 40188,
                    "driveToNextSec": 0,
                    "distanceToNextMt": 0,
                    "displayLabel": ""
                  }
                ]
              }
            },
            "orders": {
              "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7": {
                "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
                "name": "Order 6 - Proposal",
                "eligibility": {
                  "on": "20151204"
               },
                "forceVehicleId": null,
                "priority": 0,
                "loads": {
                  "people": 2
                },
                "delivery": {
                  "location": {
                    "address": "2001 2nd Ave, Jasper, AL 35501, USA"
                  },
                  "timeWindows": [
                    {
                      "startSec": 46800,
                      "endSec": 50400
                    }
                  ],
                  "notes": "Proposal order to be added via API",
                  "serviceTimeSec": 1800,
                  "tagsIn": [],
                  "tagsOut": [],
                  "customFields": {
                    "my custom field": "custom field content",
                    "orderId": "abcd1234"
                  }
                },
                "isService": false
              },
              "e2524914-3611-433b-9209-3ee59ee3996e": {
                "id": "e2524914-3611-433b-9209-3ee59ee3996e",
                "name": "Order 6",
                "eligibility": {
                  "type": "any",
                  "onDates": [
                    "20151203"
                  ]
                },
                "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
                "priority": 0,
                "loads": {
                  "people": 400
                },
                "pickup": {
                  "depotId": null,
                  "location": {
                    "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
                    "latLng": [
                      33480873,
                      -86788220
                    ],
                    "status": "OK"
                  },
                  "timeWindows": [],
                  "notes": "Demonstrate the concept of force a vehicle, apply different eligibility type",
                  "serviceTimeSec": 600,
                  "tagsIn": [],
                  "tagsOut": [],
                  "customFields": {}
                },
                "delivery": null,
                "isService": false
              },
              "deb5a845-40f8-42e0-963e-9646531894a4": {
                "id": "deb5a845-40f8-42e0-963e-9646531894a4",
                "name": "order2",
                "eligibility": {
                  "type": "on",
                  "onDates": [
                    "20151205"
                  ]
                },
                "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
                "priority": 0,
                "loads": {},
                "pickup": null,
                "delivery": {
                  "depotId": null,
                  "location": {
                    "address": "33.833605,-87.277556",
                    "latLng": [
                      33833604,
                      -87277556
                    ],
                    "status": "OK"
                  },
                  "timeWindows": [],
                  "notes": "",
                  "serviceTimeSec": 900,
                  "tagsIn": [],
                  "tagsOut": [],
                  "customFields": {}
                },
                "isService": false
              }
            },
            "vehicles": {
              "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
                "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
                "idx": 2,
                "externalId": "Vehicle 2",
                "tracked": true,
                "color": "5500FF",
                "settings": {
                  "20151203": {
                    "available": true,
                    "notes": "",
                    "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                    "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                    "timeWindow": {
                      "startSec": 28800,
                      "endSec": 61200
                    },
                    "flexStartTime": true,
                    "perStopCost": 0,
                    "perStopTimeSec": 0,
                    "maxWorkingTimeSec": 0,
                    "maxDrivingTimeSec": 0,
                    "maxDistanceMt": 0,
                    "breaks": [],
                    "loadCapacities": {
                      "people": 600
                    },
                    "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                    "activationCost": 0,
                    "drivingTimeCost": 2000,
                    "idleTimeCost": 2000,
                    "serviceTimeCost": 2000,
                    "breakTimeCost": 2000,
                    "kmCost": 100,
                    "tags": [
                      "heavy"
                    ],
                    "speedFactor": 100
                  },
                  "20151204": {
                    "available": true,
                    "notes": "",
                    "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                    "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                    "timeWindow": {
                      "startSec": 28800,
                      "endSec": 61200
                    },
                    "flexStartTime": true,
                    "perStopCost": 0,
                    "perStopTimeSec": 0,
                    "maxWorkingTimeSec": 0,
                    "maxDrivingTimeSec": 0,
                    "maxDistanceMt": 0,
                    "breaks": [],
                    "loadCapacities": {
                      "people": 600
                    },
                    "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                    "activationCost": 0,
                    "drivingTimeCost": 2000,
                    "idleTimeCost": 2000,
                    "serviceTimeCost": 2000,
                    "breakTimeCost": 2000,
                    "kmCost": 100,
                    "tags": [
                      "heavy"
                    ],
                    "speedFactor": 100
                  },
                  "20151205": {
                    "available": true,
                    "notes": "",
                    "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                    "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                    "timeWindow": {
                      "startSec": 28800,
                      "endSec": 61200
                    },
                    "flexStartTime": true,
                    "perStopCost": 0,
                    "perStopTimeSec": 0,
                    "maxWorkingTimeSec": 0,
                    "maxDrivingTimeSec": 0,
                    "maxDistanceMt": 0,
                    "breaks": [],
                    "loadCapacities": {
                      "people": 600
                    },
                    "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                    "activationCost": 0,
                    "drivingTimeCost": 2000,
                    "idleTimeCost": 2000,
                    "serviceTimeCost": 2000,
                    "breakTimeCost": 2000,
                    "kmCost": 100,
                    "tags": [
                      "heavy"
                    ],
                    "speedFactor": 100
                  }
                }
              }
            },
            "depots": {
              "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
                "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "name": "TEST",
                "setupCost": -1,
                "setupTimeSec": -1,
                "location": {
                  "address": "320 20th St W, Jasper, AL 35501, USA",
                  "latLng": [
                    33831316,
                    -87278355
                  ],
                  "status": "OK"
                },
                "color": "998800"
              }
            },
            "drivers": {
              "a3935987-4944-462f-b602-4a3a12beeeff": {
                "id": "a3935987-4944-462f-b602-4a3a12beeeff",
                "name": "Driver 1",
                "email": "driver1@example.com"
              }
            }
          }
        },
        {
          "status": "NOT_FOUND"
        }
      ]
    }
]

Retrieve all sets of proposals for the specified territory (synchronous).

THROTTLING

Leaky bucket (size:10, refill: 1 per second)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/territories/:territoryId/experimental/proposals

RETURN VALUES (synchronous)

List of ProposalsSet

Delete ProposalsSet

curl -X DELETE https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals/f59d7e47-d67b-41a6-9cd4-fca9d481dec0?key=AUTH_KEY
DELETE /api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals/f59d7e47-d67b-41a6-9cd4-fca9d481dec0 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json

The above command returns JSON structured like this:

{}

Deletes the set of proposals identified by proposalsSetId.
Note: If the computation of the specified set is still in progress it is cancelled.

THROTTLING

Leaky bucket (size:10, refill: 1 per second)

HTTP REQUEST

DELETE https://wwrm.workwave.com/api/v1/territories/:territoryId/experimental/proposals/:proposalsSetId

RETURN VALUES (synchronous)

Empty object

Apply Proposal

curl -H "Content-Type: application/json" -X PUT -d 'insert request body below' https://wwrm.workwave.com/api/v1/territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals/f59d7e47-d67b-41a6-9cd4-fca9d481dec0?key=AUTH_KEY
POST /territories/429defc8-5b05-4c3e-920d-0bb911a61345/experimental/proposals/f59d7e47-d67b-41a6-9cd4-fca9d481dec0 HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com
Content-Type: application/json
{
    "proposalsIndexes": [
      0,1
    ]
}

The above command returns JSON structured like this:

{
  "requestId": "16e00aeb-7c2b-46d2-b0c8-8b7ccc9c7060"
}

And triggers an ProposalApplied Notification (POSTed to the callback URL) structured like this:

{
  "requestId": "f59d7e47-d67b-41a6-9cd4-fca9d481dec0",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "proposalApplied",
  "data": {
    "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
    "routeId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
    "proposalIndexApplied": 1
  }
}

Accept the requested proposal from the given set of proposals, adding the Order to the plan and assigning it to the Route identified by the selected proposal (asynchronous).

IMPORTANT: A proposal can be applied if and only if the revision of the Route identified by the proposal has not changed since when the set of proposals was computed. If the Route revision changed between the time when the set of proposals was computed and when one of the proposals is applied, the request will fail.

Note: Successfully applying a proposal automatically removes its owning ProposalsSet, freeing up room for computing a new set of proposals

THROTTLING

Leaky bucket (size:10, refill: 1 per second)

HTTP REQUEST

PUT https://wwrm.workwave.com/api/v1/territories/:territoryId/experimental/proposals/:proposalsSetId

REQUEST BODY

Property Type Description
proposalsIndexes list of int List of zero-based indexes: each index i corresponds to i-th proposal to be applied within the set of proposals.
If multiple indexes are passed, the first compatible result in the list is applied.

RETURN VALUES (synchronous)

Property Type Description
requestId String Request ID assigned to the asynchronous request (reported in the asynchronous notification).

RETURN VALUES (asynchronous notification)

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to proposalApplied
data ProposalApplied OR ErrorResponse

GPS Tracking API

List GPS Devices

curl https://wwrm.workwave.com/api/v1/gps/devices?key=AUTH_KEY
GET /api/v1/gps/devices HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "devices": {
    "40519": {
      "id": "40519",
      "label": "Green Van - SBA 1234A" ,
      "category": "PHYSICAL"
    },
    "41267": {
      "id": "41267",
      "label": "Red Van - SBA 7231B" ,
      "category": "PHYSICAL"
    },
    "42676": {
      "id": "42676",
      "label": "Yellow Van - SBA 6183A" ,
      "category": "PHYSICAL"
    },
    "57290": {
      "id": "57290",
      "label": "Alice's Phone",
      "category": "MOBILE"
    },
    "57291": {
      "id": "57291",
      "label": "Bob's Phone",
      "category": "MOBILE"
    }
  }
}

List all GPS devices as provisioned on the connected WorkWave GPS service (synchronous). A GPS device can be either PHYSICAL (e.g.: a GPS unit installed in a vehicle) or MOBILE (e.g.: a smartphone where the WorkWave Route Manger App is installed).

THROTTLING

Rate-limit (1 call every 10 secs)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/gps/devices

RETURN VALUES

Property Type Description
devices map[String]GpsDevice A map where the key is the GPS deviceId and the value is the associated GpsDevice object

List Current GPS Info

curl https://wwrm.workwave.com/api/v1/gps/devices/current?key=AUTH_KEY
GET /api/v1/gps/devices/current HTTP/1.0
Accept: application/json
X-WorkWave-Key: YOUR API KEY
Host: wwrm.workwave.com

The above command returns JSON structured like this:

{
  "currentInfos": {
    "40519": {
      "id": "40519",
      "latLng": [
        33817872,
        -87266893
      ],
      "ts": 1449150077,
      "heading": 60,
      "speedMs": 7
    },
    "41267": {
      "id": "41267",
      "latLng": [
        33480873,
        -86788220
      ],
      "ts": 1449142877,
      "heading": 101,
      "speedMs": 9
    },
    "42676": {
      "id": "42676",
      "latLng": [
        33480873,
        -86788220
      ],
      "ts": 1449154517,
      "heading": 242,
      "speedMs": 0
    },
    "57290": {
      "id": "57290",
      "latLng": [
        33833604,
        -87277556
      ],
      "ts": 1449156217,
      "heading": 342,
      "speedMs": 20
    },
    "57291": {
      "id": "57291",
      "latLng": [
        33836824,
        -87266029
      ],
      "ts": 1449155557,
      "heading": 164,
      "speedMs": 0
    }
  }
}

Return last-known/most-recent information about all provisioned GPS devices. This includes timestamp, position, heading and speed (synchronous).

THROTTLING

Rate-limit (1 call every 10 secs)

HTTP REQUEST

GET https://wwrm.workwave.com/api/v1/gps/devices/current

RETURN VALUES

Property Type Description
currentInfos map[String]GpsSample A map where the key is the GPS deviceId and the value is the associated GpsSample object

Asynchronous Notifications

Mechanics

Async notifications are POSTed to the configured Callback URL under the following circumstances:

  1. to notify the completion of an asynchronous API request
  2. to notify that some Orders changed as the result of either an API request or a manual request performed via the Web Application
  3. to notify that Routes for a given date have been marked as “Approved”

When one of the above events happens, an HTTP(S) POST request is sent from one the WorkWave Route Manager servers to the Callback URL.

Different notifications carry different information encoded in JSON format in the request body. The format of each body type is outlined in the following Chapters.

The remote server is expected to accept the TCP connection within 5 seconds and return an HTTP 200 OK code within 15 seconds.
Failing that, the Callback URL is invoked again up to 5 times according to the following retry strategy:

It is therefore strongly advised not to perform any time-consuming processing logic as part of the thread that receives the notification request, but to delegate such actions to other threads so that the receiving thread can immediately reply with a 200 OK response.

OrdersChanged Notification

Adding new Orders triggers a notification structured like this:

{
  "requestId": "509900a5-392e-4d34-bcfe-90cc6bf3ad47",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [
      {
        "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "geocodeStatus": {
          "delivery": "OK"
        }
      },
      {
        "id": "89009ba2-285f-47a1-8b91-5524d8f31b16",
        "geocodeStatus": {
          "delivery": "LOW_ACCURACY"
        }
      },
      {
        "id": "6a0c1374-e07c-410d-98d2-dd7be1f02ffa",
        "geocodeStatus": {
          "delivery": "NOT_FOUND"
        }
      },
      {
        "id": "3d499ad0-14f6-4a38-acd8-05b8269dec78",
        "geocodeStatus": {
          "delivery": "POSTCODE_ISSUE"
        }
      },
      {
        "id": "a5682ad9-97e8-4719-9bb6-eecfcfb8606b",
        "geocodeStatus": {
          "delivery": "OK"
        }
      }
    ],
    "updated": [],
    "deleted": []
  }
}

Updating or replacing an existing Order triggers a notification structured like this:

{
  "requestId": "cdecbe3a-4115-4240-8d44-0cfa2fc14fb6",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [
      {
        "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "geocodeStatus": {
          "delivery": "OK"
        }
      }
    ],
    "deleted": []
  }
}

Deleting Orders triggers a notification structured like this:

{
  "requestId": "9c66f107-320f-4ae5-85f6-3dddaa7c8c8e",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "ordersChanged",
  "data": {
    "created": [],
    "updated": [],
    "deleted": [
      "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
      "a5682ad9-97e8-4719-9bb6-eecfcfb8606b"
    ]
  }
}

Notifies that some Orders’ data has changed.

This can be the result of an asynchronous API request such as the ones described at Orders API or of a manual operation performed via the Web Application.

In general, any operation that changes Orders’ data (create/update/delete) triggers an ordersChanged notification.

An application interested in this type of notification would, upon receiving it, typically check whether the notification is about an action that was initiated by itself (by checking the requestId) and if not, issue a Get Orders request to fetch the details of the updated Order(s).

REQUEST BODY

Property Type Description
requestId String OR null Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to ordersChanged
data OrdersChanged OR ErrorResponse Details about the outcome of the change event

VehiclesChanged Notification

Adding a new Vehicle (from the UI) triggers a notification structured like this:

{
  "requestId": null,
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "vehiclesChanged",
  "data": {
    "created": [
        "875cceab-0952-4101-9db3-e524dbec9a75"
    ],
    "updated": [],
    "deleted": []
  }
}

Updating an existing Vehicle triggers a notification structured like this:

{
  "requestId": "302f2060-c132-4079-8565-9f543ea581ea",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "vehiclesChanged",
  "data": {
    "created": [],
    "updated": [
        "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7"
    ],
    "deleted": []
  }
}

Deleting a Vehicle (from the UI) triggers a notification structured like this:

{
  "requestId": null,
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "vehiclesChanged",
  "data": {
    "created": [],
    "updated": [],
    "deleted": [
        "0d8855e6-28a0-4e89-9c67-b44c66c39ba6"
    ]
  }
}

Notifies that some Vehicles’ data has changed.

This can be the result of an asynchronous API request such as the ones described at Vehicles API or of a manual operation performed via the Web Application.

In general, any operation that changes Vehicles’ data (create/update/delete) triggers a vehiclesChanged notification.

An application interested in this type of notification would, upon receiving it, typically check whether the notification is about an action that was initiated by itself (by checking the requestId) and if not, issue a List Vehicles or a Get Vehicle Settings request to fetch the details of the updated Vehicle(s).

REQUEST BODY

Property Type Description
requestId String OR null Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to vehiclesChanged
data VehiclesChanged OR ErrorResponse Details about the outcome of the change event

DriversChanged Notification

Adding a new Driver triggers a notification structured like this:

{
  "requestId": "88b79f3b-28bf-4bd6-82ae-9c523f3cc20b",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "driversChanged",
  "data": {
    "created": [
        "0129724f-b80d-4011-ab91-3e4ae2f62896"
    ],
    "updated": [],
    "deleted": []
  }
}

Updating an existing Driver triggers a notification structured like this:

{
  "requestId": "9ca2501f-19f1-42b0-b17c-3ebe585776c6",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "driversChanged",
  "data": {
    "created": [],
    "updated": [
        "a3935987-4944-462f-b602-4a3a12beeeff"
    ],
    "deleted": []
  }
}

Deleting a Driver triggers a notification structured like this:

{
  "requestId": "aac2fe79-5cc9-485a-9a24-b48d3d03db49",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "driversChanged",
  "data": {
    "created": [],
    "updated": [],
    "deleted": [
        "a08213e6-673f-4efc-955e-2bf587813162"
    ]
  }
}

Notifies that some Drivers’ data has changed.

This can be the result of an asynchronous API request such as the ones described at Drivers API or of a manual operation performed via the Web Application.

In general, any operation that changes Drivers’ data (create/update/delete) triggers a driversChanged notification.

An application interested in this type of notification would, upon receiving it, typically check whether the notification is about an action that was initiated by itself (by checking the requestId) and if not, issue a List Drivers request to fetch the details of the updated Drivers.

REQUEST BODY

Property Type Description
requestId String OR null Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to driversChanged
data DriversChanged OR ErrorResponse Details about the outcome of the change event

VehicleDriverAssignmentsChanged Notification

Replacing Vehicle-Drivers Assignments triggers a notification structured like this:

{
  "requestId": "c3f7257a-3c5d-4870-bddc-e8845da1a227",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "vehicleDriverAssignmentsChanged",
  "data": {}
}

Notifies that some Vehicle-Driver assignments have changed.

This can be the result of an asynchronous API request such as the ones described at Vehicle-Driver Assignments API or of a manual operation performed via the Web Application.

An application interested in this type of notification would, upon receiving it, typically check whether the notification is about an action that was initiated by itself (by checking the requestId) and if not, issue a Get Driver Assignments request to fetch the details of the updated assignments.

REQUEST BODY

Property Type Description
requestId String OR null Request ID associated to the originating asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to vehicleDriverAssignmentsChanged
data empty object OR ErrorResponse

ExecutionEventsProcessed Notification

Sending Execution Events triggers a notification structured like this:

{
  "requestId": "a6f01d6b-a085-4812-8784-48d26d888809",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "executionEventsProcessed",
  "data": {
    "processed": [
      "OK",
      "OK",
      "ERROR_VEHICLE_NOT_TRACKED",
      "OK_WARN_LATLNG_OUT_OF_BOUNDS",
      "OK"
    ]
  }
}

Sending Execution Events while a WebApp-initiated Editing Transaction is in progress triggers a notification structured like this:

{
  "requestId": "303dd2b5-22c4-4fe9-9586-a6b168d96658",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "executionEventsProcessed",
  "data": {
    "processed": [
      "POSTPONED",
      "POSTPONED",
      "POSTPONED"
    ]
  }
}

Notifies that an API-initiated Send Execution Events request completed.

REQUEST BODY

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to executionEventsProcessed
data ExecutionEventsProcessed OR ErrorResponse Details about the outcome of the update event

ApprovedRoutesChanged Notification

Approving Routes and/or revoking Routes approval triggers a notification structured like this:

{
  "requestId": "94accf16-dab4-4a6d-85b1-eda4bff10842",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "approvedRoutesChanged",
  "data": {
    "approved": ["20151204", "20151205"],
    "revoked": ["20151206"]
  }
}

Notifies changes to dates where Routes have been either marked as approved (i.e.: ready to be dispatched and visible to mobile apps) or have been revoked approval (i.e.: not ready to be dispatched, no more visible to mobile apps).

This is the result of either API-initiated Approve Routes or Revoke Routes requests or a manual operation performed via the Web Application (via the “Approve and Dispatch” button).

An application interested in this type of notification would, upon receiving it, typically issue a List Approved Routes request to retrieve details about the approved Routes.

REQUEST BODY

Property Type Description
requestId String OR null Request ID associated to the asynchronous request, or null if the originating request is a manual change (performed from the UI)
territoryId UUID Territory ID
event String Set to approvedRoutesChanged
data ApprovedRoutesChanged OR ErrorResponse Details about the outcome of the update event

SchedulingCompleted Notification

Building Routes triggers a notification structured like this:

{
  "requestId": "758aa6e2-f450-4f2e-9559-b928e39fb5f9",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {}
}

Fitting-In Unassigned Orders triggers a notification structured like this:

{
  "requestId": "13d8ddf5-7fbc-49e5-a2b3-cb4d10b80827",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {
    "orderIds": [
      "603a348f-7fcc-4bdc-8f4a-ec10a68547e0"
    ]
  }
}

Unassigning Orders triggers a notification structured like this:

{
  "requestId": "1bf2f905-522f-42ab-bc06-d2bfb5dd4f06",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {
    "orderIds": [
      "603a348f-7fcc-4bdc-8f4a-ec10a68547e0"
    ]
  }
}

Assigning OrderSteps triggers a notification structured like this:

{
  "requestId": "ebc076b0-18ba-40d6-963a-288d0cc1e33f",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {
    "orderSteps": [
      {
        "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "type": "delivery"
      }
    ]
  }
}

Notifies that an API-initiated scheduling request completed.

This is the result of the asynchronous API requests described at Scheduling API.

REQUEST BODY

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to schedulingCompleted
data SchedulingCompleted OR ErrorResponse Details about the outcome of the update event

ProposalsSetProcessed Notification

Compute ProposalsSet triggers a notification structured like this:

{
  "requestId": "f59d7e47-d67b-41a6-9cd4-fca9d481dec0",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "proposalsSetProcessed",
  "data": {
    "order": {
      "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
      "geocodeStatus": {
        "delivery": "OK"
      }
    },
    "proposals": [
      {
        "status": "NOT_FOUND"
      },
      {
        "status": "FOUND",
        "routeId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
        "startSec": 38265
      },
      {
        "status": "NOT_FOUND"
      }
    ]
  }
}

Notifies that of a set of proposals has been computed and stored for review and proposal application

REQUEST BODY

Property Type Description
requestId String Request ID associated to the asynchronous request, also doubles as the ID of the stored ProposalsSet
territoryId UUID Territory ID
event String Set to proposalsSetProcessed
data ProposalsSetProcessed OR ErrorResponse Details about the outcome of the processed event

ProposalApplied Notification

Apply Proposal triggers a notification structured like this:

{
  "requestId": "f59d7e47-d67b-41a6-9cd4-fca9d481dec0",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "schedulingCompleted",
  "data": {
    "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
    "routeId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
    "proposalIndexApplied": 1
  }
}

Notifies the application of a proposal, resulting in the addition of the Order to the plan and its assignment to the Route identified by the selected proposal.

REQUEST BODY

Property Type Description
requestId String Request ID associated to the asynchronous request
territoryId UUID Territory ID
event String Set to proposalApplied
data ProposalApplied OR ErrorResponse Details about the outcome of the processed event

Object Definitions

Territory objects

Territory Object properties

{
  "id": "4cf132f2-e0bc-4a1b-a167-a4b80056690c",
  "name": "New York",
  "center": [40737716, -73988150],
  "timeZoneCode": "America/New_York",
  "languageCode": "en"
}
Property Type Description
id UUID Globally Unique Territory ID
name String Territory’s name
center LatLng Territory’s center coordinates
timeZoneCode String List of time zones in the tz database
E.g.: America/New_York, Europe/Rome
languageCode String IETF language tag
E.g.: en, en-US, pt-BR

Depot objects

Depot Object properties

{
  "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
  "name": "Depot A",
  "setupCost": 1000,
  "setupTimeSec": 1800,
  "location": {
    "address": "320 20th St W, Jasper, AL 35501, USA",
    "latLng": [
      33831316,
      -87278355
    ],
    "status": "OK"
  },
  "color": "998800"
}
Property Type Description
id UUID Unique (per-territory) Depot ID
name String Depot’s name
location Location Depot’s location
setupCost int Cost that is factored in every time the Vehicle goes back to this Depot to reload
setupTimeSec int Setup time in seconds that is factored in every time the Vehicle goes back to this Depot to reload
color String Depot’s color in RGB hex format (e.g.: FFA0C3)

Region objects

Region Object properties

{
  "id": "ddcbe348-5b4d-483d-9d6c-1b149120ca7e",
  "name": "South Jasper",
  "color": "2E5984",
  "poly": [
    [33840336, -87319165],
    [33839766, -87220803],
    [33794127, -87229386],
    [33792558, -87245007],
    [33812528, -87259598],
    [33812956, -87305947],
    [33812956, -87325860]
  ],
  "enterCost": 2000,
  "enterTimeSec": 1200
}
Property Type Description
id UUID Unique (per-territory) Vehicle ID
name String Region’s name
color String Region’s color in RGB hex format (e.g.: FFA0C3)
poly list of LatLng List of locations defining a valid (non-collinear, non-self-intersecting) polygon
enterCost int Cost in cents that is factored in every time a Vehicle moves from a location that is outside of this Region to an Order that is within this Region
enterTimeSec int Time in seconds that is added to the driving time every time the vehicle drives from a location that is outside of this Region to an Order that is within this Region

Vehicle objects

Vehicle Object properties

{
  "id": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
  "idx": 1,
  "externalId": "Vehicle 1",
  "tracked": true,
  "color": "009944",
  "gpsDeviceId": "40519"
}
Property Type Description
id UUID Unique (per-territory) Vehicle ID
idx int Unique (per-territory) numeric index associated to the Vehicle (used for display purposes when setting displayLabel)
externalId String Unique (per-territory) external ID associated to the Vehicle
tracked boolean true if the vehicle is tracked via a mobile application, false otherwise
color String Vehicle’s color in RGB hex format (e.g.: FFA0C3),
gpsDeviceId String The GPS device id associated to this Vehicle. null if either no GPS device is associated or no WorkWave GPS account is connected

VehicleFull Object properties

{
  "id": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
  "idx": 1,
  "externalId": "Vehicle 1",
  "tracked": true,
  "color": "009944",
  "settings": {
    "20151203": {
      "available": true,
      "notes": "",
      "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
      "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
      "timeWindow": {
        "startSec": 28800,
        "endSec": 61200
      },
      "flexStartTime": true,
      "perStopCost": 0,
      "perStopTimeSec": 0,
      "maxWorkingTimeSec": 0,
      "maxDrivingTimeSec": 0,
      "maxDistanceMt": 0,
      "breaks": [],
      "loadCapacities": {
        "frozen ton": 500,
        "regular ton": 500
      },
      "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
      "activationCost": 0,
      "drivingTimeCost": 2000,
      "idleTimeCost": 2000,
      "serviceTimeCost": 2000,
      "breakTimeCost": 2000,
      "kmCost": 100,
      "tags": [
        "frozen",
        "regular"
      ],
      "speedFactor": 100
    },
    "20151204": { ... }, // more settings for 2015-12-04
    ...                  // more settings for more dates
  }
}
Property Type Description
id UUID Unique (per-territory) Vehicle ID
idx int Unique (per-territory) numeric index associated to the Vehicle (used for display purposes when setting displayLabel)
externalId String Unique (per-territory) external ID associated to the Vehicle
tracked boolean True if the vehicle is tracked via a mobile application, false otherwise
color String Vehicle’s color in RGB hex format (e.g.: FFA0C3)
settings map[DateString] VehicleSettings Maps a date to additional date-related settings

VehicleSettings Object properties

{
  "available": true,
  "notes": "",
  "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
  "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
  "timeWindow": {
    "startSec": 28800,
    "endSec": 61200
  },
  "flexStartTime": true,
  "perStopCost": 0,
  "perStopTimeSec": 0,
  "maxWorkingTimeSec": 0,
  "maxDrivingTimeSec": 0,
  "maxDistanceMt": 0,
  "breaks": [],
  "loadCapacities": {
    "frozen ton": 500,
    "regular ton": 500
  },
  "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
  "activationCost": 0,
  "drivingTimeCost": 2000,
  "idleTimeCost": 2000,
  "serviceTimeCost": 2000,
  "breakTimeCost": 2000,
  "kmCost": 100,
  "tags": [
    "frozen",
    "regular"
  ],
  "speedFactor": 100
}
Property Type Description
available boolean True if the Vehicle (or Driver) is available to drive on this date, false otherwise
notes String Account-owner-entered notes for this date
departureDepotId UUID OR null ID of the departure depot, or null if the Vehicle’s departure location is the first visited Order (aka: open-start)
arrivalDepotId UUID OR null ID of the arrival depot, or null if the Vehicle does not have to return to any specific end destination (aka: open-end or open-route)
timeWindow TimeWindow OR null The Vehicle (or Driver) working time window on this date
flexStartTime boolean If false forces the vehicle to leave its departure depot at the beginning of its working time window, otherwise the vehicle can be scheduled to leave at a later time if that reduces the overall costs
perStopCost int Cost in cents that is factored in every time the vehicle stops at a different place, depots excluded.
LIMITS: must range between 0 and 100_000_000, inclusive.
perStopTimeSec int Time in seconds that is factored in every time the vehicle stops at a different place, depots excluded (e.g.: average parking time).
LIMITS: must be less than 24 hours (86400 secs).
maxWorkingTimeSec int Maximum allowed working time, in seconds (includes driving time, idle time, service time and break time). Zero means no limit.
LIMITS: must be less than 24 hours (86400 secs).
maxDrivingTimeSec int Maximum allowed driving time, in seconds. Zero means no limit.
LIMITS: must be less than 24 hours (86400 secs).
maxDistanceMt int Maximum allowed driving distance, in meters. Zero means no limit.
breaks list of Break Driver breaks.
LIMITS: cannot contain more than 3 Breaks.
Multiple breaks cannot overlap each other and overlapping takes break duration into account.
For overlap-checking consider a break as starting at its startSec and ending at endSec+durationSec, inclusive.
E.g.: a 1 hour break starting between 1pm and 2pm can potentially be scheduled at 2pm therefore extending up to 3pm, so it can overlap a second break set between 2.30pm and 3.30pm.
loadCapacities map[String]int Maximum load allowances.
IMPORTANT: only lowercase is accepted for load keys. All uppercase characters are automatically and silently lowercased on import
LIMITS: each VehicleSettings cannot contain more than 20 load items (different VehicleSettings can still contain different sets of up to 20 items).
The string identifying a load key cannot be empty nor longer than 30 characters.
Load values must be integers ranging between 0 and 1_000_000_000, inclusive.
regionIds list of UUID UUID of Regions associated to this Vehicle on this date
activationCost int Cost that must be factored in if this Vehicle is used. In cents.
LIMITS: must range between 0 and 100_000_000, inclusive.
drivingTimeCost int In cents per hour.
LIMITS: must range between 0 and 100_000_000, inclusive.
idleTimeCost int In cents per hour.
LIMITS: must range between 0 and 100_000_000, inclusive.
serviceTimeCost int In cents per hour.
LIMITS: must range between 0 and 100_000_000, inclusive.
breakTimeCost int In cents per hour.
LIMITS: must range between 0 and 100_000_000, inclusive.
kmCost int In cents per kilometer.
LIMITS: must range between 0 and 100_000_000, inclusive.
tags list of String Tags are referenced by OrderSteps’ tagsIn and tagsOut properties to restrict vehicle-order assignments. See OrderStep properties for more details.
IMPORTANT: only lowercase is accepted. All uppercase characters are automatically and silently lowercased on import
LIMITS: cannot contain more than 50 items. Each item cannot be longer than 50 characters.
speedFactor int Relative average vehicle speed in percent. Ranges between 50% and 200%. Defaults to 100%

Driver objects

Driver Object properties

{
  "id": "a3935987-4944-462f-b602-4a3a12beeeff",
  "name": "Driver 1",
  "email": "driver1@example.com",
  "gpsDeviceId": "57290"
}
Property Type Description
id UUID Unique Driver ID
name String Driver name
email String Driver email
gpsDeviceId String The GPS device id associated to this Driver. null if either no GPS device is associated or no WorkWave GPS account is connected

DriverInput Object properties

{
  "name": "Driver 3",
  "email": "driver3@example.com",
  "password": "PhQ?Hqrt$4bs6_^2",
  "gpsDeviceId": null
}
Property Type Description
name String Driver name
email String Driver email
password String Driver password
gpsDeviceId String Optional: a GPS device id provisioned with category “MOBILE”.
IMPORTANT: requires a connected WorkWave GPS account. Must be omitted or set to null otherwise.

Order objects

Order Object properties

{
  "id": "49269a16-479c-4531-8ffd-513b7ccd0621",
  "name": "Order 1",
  "eligibility": {
    "type": "on",
    "onDates": [
      "20151204",
      "20151205",
      "20151206"
    ]
  },
  "forceVehicleId": null,
  "priority": 0,
  "loads": {},
  "pickup": null,
  "delivery": {
    "depotId": null,
    "location": {
      "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA",
      "latLng": [
        33817872,
        -87266893
      ],
      "status": "OK"
    },
    "timeWindows": [
      {
        "startSec": 30600,
        "endSec": 37800
      },
      {
        "startSec": 45000,
        "endSec": 55800
      }
    ],
    "notes": "demonstrate the concept of multiple time windows as well as eligibility date range",
    "serviceTimeSec": 600,
    "tagsIn": [],
    "tagsOut": [],
    "customFields": {}
  },
  "isService": false
}
Property Type Description
id UUID Unique (per-territory) Order ID
name String Name of the Order, for visualization purposes only
eligibility Eligibility On what dates the Order is eligible to be serviced
forceVehicleId UUID OR null The id of the Vehicle that has been forcefully assigned to service this Order, if any
priority int Allowed values: -20,-10,0,10,20 where 0 is for normal priority and 20 is highest
loads map[String]int A map where the key is the load (e.g.: kgs, pounds, m3, etc) and the value is the actual value * 100 (e.g.: the value for a 100 kg load would be 10000)
pickup OrderStep OR null The pickup part of this Order, where applicable. null when isService = true
delivery OrderStep OR null The delivery part of the Order, where applicable. Set when isService = true
isService boolean True if this is a “service” Order. Service Orders are represented as “delivery” Orders with no loads.
Note: as a result, “service” Orders will show up with type = “delivery” when referenced in RouteSteps or OrderStepIdentifiers

OrderInput Object properties

{
  "name": "Added Order",
  "eligibility": {
    "type": "on",
    "onDates": [
      "20151204",
      "20151205",
      "20151206"
    ]
  },
  "forceVehicleId": null,
  "priority": 0,
  "loads": {
    "pounds": 5000,
    "cubic inches": 4500
  },
  "pickup": null,
  "delivery": {
    "depotId": null,
    "location": {
      "address": "3101 Florida Ave, Jasper, AL 35501, USA"
    },
    "timeWindows": [
      {
        "startSec": 30600,
        "endSec": 37800
      },
      {
        "startSec": 45000,
        "endSec": 55800
      }
    ],
    "notes": "deliver and connect equipment on site",
    "serviceTimeSec": 600,
    "tagsIn": [
      "plumbing skills",
      "power tools"
    ],
    "tagsOut": [
      "large vehicle"
    ],
    "customFields": {
      "OrderID": "XDTG-14356",
      "PIN": "1234"
    }
  },
  "isService": false
}
Property Type Description
name String Name of the Order, for visualization purposes only.
LIMITS: limited to 100 characters. Longer names will be truncated.
eligibility Eligibility On what dates the Order is eligible to be serviced.
LIMITS: dates cannot be in the past nor exceed the allowed maximum horizon.
forceVehicleId UUID OR null Optional. Set to null to let the system select the best Vehicle
priority int Allowed values: -20,-10,0,10,20 where 0 is for normal priority and 20 is highest
loads map[String]int A map where the key is the load (e.g.: kgs, pounds, m3, etc) and the value is the actual value * 100 (e.g.: the value for a 100 kg load would be 10000)
IMPORTANT: only lowercase is accepted for load keys. All uppercase characters are automatically and silently lowercased on import
LIMITS: each Order cannot contain more than 10 load items (different Orders can still contain different sets of up to 10 items).
The string identifying a load key cannot be empty nor longer than 30 characters.
Load values must be integers ranging between 0 and 1_000_000_000, inclusive.
pickup OrderStepInput The pickup part of this Order, where applicable. Must be null if isService = true
delivery OrderStepInput The delivery part of the Order, where applicable. Must be set if isService = true
isService boolean Optional, defaults to false. Let the UI know that this order should be presented as a “service” one.Service Orders are actually “delivery” Orders with no loads.
Note: as a result, “service” Orders will show up with type = “delivery” when referenced in RouteSteps

OrderStep Object properties

{
  "depotId": null,
  "location": {
    "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA",
    "latLng": [
      33817872,
      -87266893
    ],
    "status": "OK"
  },
  "timeWindows": [
    {
      "startSec": 30600,
      "endSec": 37800
    },
    {
      "startSec": 45000,
      "endSec": 55800
    }
  ],
  "timeWindowExceptions": {
    "20151205": [
      {
        "startSec": 64800,
        "endSec": 68400
      }
    ],
    "20151206": [
      {
        "startSec": 30600,
        "endSec": 37800
      },
      {
        "startSec": 61200,
        "endSec": 64800
      }
    ]
  },
  "notes": "deliver and connect equipment on site",
  "serviceTimeSec": 600,
  "tagsIn": [
    "plumbing skills",
    "power tools"
  ],
  "tagsOut": [
    "large vehicle"
  ],
  "customFields": {
    "OrderID": "XDTG-14356",
    "PIN": "1234"
  }
}
Property Type Description
depotId UUID OR null Depot Id. Only set if the OrderStep’s location is at a Depot, null otherwise
location Location OR null Order’s location, null if this OrderStep is located at a Depot
timeWindows list of TimeWindow When the OrderStep can be serviced during each eligible day
timeWindowExceptions map[DateString] list of TimeWindow Overrides timeWindows on specific dates
notes String Order notes. For visualization purposes only
serviceTimeSec int Expected service time in seconds
tagsIn list of String A list of tags that a Vehicle must define to be able to service this OrderStep
tagsOut list of String Vehicles defining one or more of these tags cannot service this OrderStep
customFields map[String]String Custom fields associated to this OrderStep. For visualization purposes only

OrderStepInput Object properties

{
  "depotId": null,
  "location": {
    "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA"
  },
  "timeWindows": [
    {
      "startSec": 30600,
      "endSec": 37800
    },
    {
      "startSec": 45000,
      "endSec": 55800
    }
  ],
  "timeWindowExceptions": {
    "20151205": [
      {
        "startSec": 64800,
        "endSec": 68400
      }
    ],
    "20151206": [
      {
        "startSec": 30600,
        "endSec": 37800
      },
      {
        "startSec": 61200,
        "endSec": 64800
      }
    ]
  },
  "notes": "deliver and connect equipment on site",
  "serviceTimeSec": 600,
  "tagsIn": [
    "plumbing skills",
    "power tools"
  ],
  "tagsOut": [
    "large vehicle"
  ],
  "customFields": {
    "OrderID": "XDTG-14356",
    "PIN": "1234"
  }
}
Property Type Description
depotId UUID OR null Depot Id (if the OrderStep’s location is at a Depot)
Note: Only one of “depotId” and “location” can be specified
location LocationInput OR null Order’s location (if the OrderStep does not coincide with a Depot)
Note: Only one of “depotId” and “location” can be specified
timeWindows list of TimeWindow When the OrderStep can be serviced during each eligible day.
LIMITS: cannot contain more than 4 TimeWindows.
timeWindowExceptions map[DateString] list of TimeWindow Allows overriding timeWindows on specific dates.
LIMITS: cannot contain more than 3 dates, where each date cannot reference more than 4 TimeWindows.
Specified dates must match the Order’s eligibility range
notes String Notes.
LIMITS: limited to 1500 characters. Longer notes will be truncated.
serviceTimeSec int Expected service time in seconds.
LIMITS: must be less than 24 hours (86400 secs).
tagsIn list of String A list of tags that a Vehicle must define to be able to service this OrderStep.
IMPORTANT: only lowercase is accepted. All uppercase characters are automatically and silently lowercased on import
LIMITS: cannot contain more than 50 items. Each item cannot be longer than 50 characters.
tagsOut list of String Vehicles defining one or more of these tags cannot service this OrderStep.
IMPORTANT: only lowercase is accepted. All uppercase characters are automatically and silently lowercased on import
LIMITS: cannot contain more than 50 items. Each item cannot be longer than 50 characters.
customFields map[String]String Custom fields associated to this OrderStep. For visualization purposes only.
LIMITS: each OrderStep cannot contain more than 20 custom fields (different OrderSteps can still contain different sets of up to 20 items).
The string identifying a custom field key cannot be empty nor longer than 50 characters.
The total combined size of all custom field values cannot exceed 3000 characters.

Route objects

Route Object properties

{
  "id": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6-20151204",
  "revision": 182,
  "date": "20151204",
  "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
  "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
  "steps": [
    {
      "type": "departure",
      "idleTimeSec": 0,
      "perStopTimeSec": 0,
      "arrivalSec": 0,
      "startSec": 0,
      "endSec": 32329,
      "driveToNextSec": -1,
      "distanceToNextMt": -1,
      "displayLabel": ""
    },
    {
      "type": "delivery",
      "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
      "idleTimeSec": 0,
      "perStopTimeSec": 0,
      "arrivalSec": 34200,
      "startSec": 34200,
      "endSec": 36000,
      "driveToNextSec": -1,
      "distanceToNextMt": -1,
      "displayLabel": "1.1",
      "trackingData": {
        "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
        "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
        "timeInSec": 34526,
        "timeInLatLng": [
          33817872,
          -87266893
        ],
        "timeOutSec": -1,
        "timeOutLatLng": null,
        "status": "done",
        "statusSec": 35912,
        "statusLatLng": [
          33817872,
          -87266893
        ],
        "timeInDetectedSec": 34201,
        "timeInDetectedLatLng": [
          33817942,
          -87266921
        ],
        "timeOutDetectedSec": 35935,
        "timeOutDetectedLatLng": [
          33817404,
          -87266657
        ]
      }
    },
    {
      "type": "pickup",
      "orderId": "0dd9cab0-d1db-45de-b291-31a0b66d5562",
      "idleTimeSec": 0,
      "perStopTimeSec": 0,
      "arrivalSec": 39600,
      "startSec": 39600,
      "endSec": 40600,
      "driveToNextSec": -1,
      "distanceToNextMt": -1,
      "displayLabel": "1.2",
      "trackingData": {
        "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
        "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
        "timeInSec": 39600,
        "timeInLatLng": [
          33480873,
          -86788220
        ],
        "timeOutSec": 40720,
        "timeOutLatLng": [
          33480873,
          -86788220
        ],
        "status": "done",
        "statusSec": 40780,
        "statusLatLng": [
          33480873,
          -86788220
        ],
        "timeInDetectedSec": 39582,
        "timeInDetectedLatLng": [
          33481223,
          -86787985
        ],
        "timeOutDetectedSec": 40795,
        "timeOutDetectedLatLng": [
          33481223,
          -86788790
        ]
      }
    }
  ]
}
Property Type Description
id String Route ID, formatted as “vehicleId-yyyyDDmm”
revision int The Route revision number. Changes every time the Route is updated
date DateString The Route date
vehicleId UUID ID of the Vehicle servicing this Route
driverId UUID OR null Null if no driver has been assigned to this route
steps list of RouteStep Ordered list of RouteSteps ( e.g.: departure, delivery #1, delivery #2, …, delivery #n, arrival )

RouteStep Object properties

{
  "type": "delivery",
  "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
  "idleTimeSec": 0,
  "perStopTimeSec": 0,
  "arrivalSec": 34200,
  "startSec": 34200,
  "endSec": 36000,
  "driveToNextSec": -1,
  "distanceToNextMt": -1,
  "displayLabel": "1.1",
  "trackingData": {
    "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
    "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
    "timeInSec": 34526,
    "timeInLatLng": [
      33817872,
      -87266893
    ],
    "timeOutSec": -1,
    "timeOutLatLng": null,
    "status": "done",
    "statusSec": 35912,
    "statusLatLng": [
      33817872,
      -87266893
    ],
    "timeInDetectedSec": 34201,
    "timeInDetectedLatLng": [
      33817942,
      -87266921
    ],
    "timeOutDetectedSec": 35935,
    "timeOutDetectedLatLng": [
      33817404,
      -87266657
    ]
  }
}
Property Type Description
type enum One of departure, arrival, pickup, delivery, brk.
Note: RouteSteps referencing “service” Orders (orders flagged with “isService=true”. See also the description of Order.isService) will have type=delivery
orderId String OR null Only set for pickup and delivery types, null otherwise
idleTimeSec int The time spent idling before start servicing an Order. It is equal to startSec – arrivalSec. Only relevant for pickup and delivery types, 0 otherwise
perStopTimeSec int
arrivalSec int The time of arrival in seconds since midnight. -1 for departure types
startSec int Service start time for pickup and delivery types, start-of-break time for brk types, identical to arrivalSec for arrival types. -1 for departure types
endSec int Departure time, in seconds since midnight, for pickup, delivery and departure types, end-of-break time for brk types, -1 for arrival types
driveToNextSec int Driving time, in seconds, to next stop. -1 when not available
distanceToNextMt int Distance to next stop. -1 when not available
displayLabel String (only for pickup and delivery types, null otherwise)
trackingData TrackingData (only for pickup and delivery types, and only for Routes returned by the Time Of Arrival APIs, null otherwise)

TrackingData Object properties

{
  "driverId": "a08213e6-673f-4efc-955e-2bf587813162",
  "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
  "timeInSec": 34526,
  "timeInLatLng": [
    33817872,
    -87266893
  ],
  "timeOutSec": -1,
  "timeOutLatLng": null,
  "status": "done",
  "statusSec": 35912,
  "statusLatLng": [
    33817872,
    -87266893
  ],
  "timeInDetectedSec": 34201,
  "timeInDetectedLatLng": [
    33817942,
    -87266921
  ],
  "timeOutDetectedSec": 35935,
  "timeOutDetectedLatLng": [
    33817404,
    -87266657
  ]
}
Property Type Description
driverId UUID OR null Id of the last Driver that updated this tracking data object. null if the last update was manually entered via the Web Application
vehicleId UUID Id of the Vehicle associated to the Driver account that reported this data
timeInSec int Time, in seconds since midnight, when the reported time-in event (service started as reported by the Driver) occurred. -1 if no time-in has been reported
timeInLatLng LatLng OR null Coordinates of the time-in event, where available
timeOutSec int Time, in seconds since midnight, when the reported time-out event (service completed as reported by the Driver) occurred. -1 if no time-out has been reported
timeOutLatLng LatLng OR null Coordinates of the time-out event, where available
status enum OR null One of reschedule, done. null if no status has been reported
statusSec int Time, in seconds since midnight, when the status-reported event occurred.-1 if no status has been reported
statusLatLng LatLng OR null Coordinates of the status-reported event, where available
timeInDetectedSec int Time, in seconds since midnight, when the detected time-in event (service started as detected by the Mobile App) occurred. -1 if no time-in could be detected
timeInDetectedLatLng LatLng OR null Coordinates of the detected time-in event. Null if no time-in could be detected
timeOutDetectedSec int Time, in seconds since midnight, when the detected time-out event (service completed as detected by the Mobile App) occurred. -1 if no time-out could be detected
timeOutDetectedLatLng LatLng OR null Coordinates of the time-out event. Null if no time-out could be detected
pods PodContainer OR null Container of categorized Proof Of Delivery objects collected for the RouteStep associated to this TrackingData

PodContainer Object properties

{
  "signatures": {
    "customer": {
      "sec": 36813,
      "latLng": [33817872, -87266893],
      "text": "John Black",
      "token": "20151204-429defc8-be30b653.png"
    }
  },
  "pictures": {
    "picture-1": {
      "sec": 35427,
      "latLng": null,
      "text": "Minor damage in lower left corner",
      "token": "20151204-429defc8-fa6e00dd.jpg"
    },
    "picture-2": { ... },  //
    ...                    // More pictures
  },
  "note": {
    "sec": 35360,
    "latLng": [33817872, -87266893],
    "text": "Best parking spot is 50mt ahead"
  }
}
Property Type Description
signatures map[SignatureType] Pod Signature images. SignatureType can be driver or customer
pictures map[String] Pod Pictures. The map key is the externally provided ID associated to the picture-type Proof of Delivery
note Pod Textual note

Pod Object properties


// Signature Pod Example
{
  "sec": 36813,
  "latLng": [33817872, -87266893],             // Coordinates. Optional
  "text": "John Black",                        // Textual description. Typically "Name/Surname". Optional
  "token": "20151204-429defc8-be30b653.png"
}

// Picture Pod Example
{
  "sec": 35427,
  "latLng": null,                              // Coordinates. Optional
  "text": "Minor damage in lower left corner", // Textual description. Optional
  "token": "20151204-429defc8-fa6e00dd.jpg"
}

// Audio Pod Example
{
  "sec": 37143,
  "latLng": null,                              // Coordinates. Optional
  "text": "Clanking noise from left engine",   // Textual description. Optional
  "token": "20151204-429defc8-56b1f8b3.aac"
}

// Note Pod Example
{
  "sec": 35360,
  "latLng": [33817872, -87266893],             // Coordinates. Optional
  "text": "Best parking spot is 50mt ahead"
}

Property Type Description
sec int Time, in seconds since midnight, when the Proof of Delivery was either posted or last updated
latLng LatLng OR null Coordinates of the Proof of Delivery event, where available
text String Text attached to the Proof of Delivery item
token String Only provided for image-type or audio-type Proof of Delivery items (signatures, pictures and audio-recordings). Used to download the referenced binary item

ExecutionEvent objects

ExecutionEvent Object properties

{
  "type": "timeIn",
  "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
  "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
  "orderStepType": "delivery",
  "date": "20151204",
  "data": {
    "sec": 35132
  }
}

{
  "type": "statusUpdate",
  "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
  "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
  "orderStepType": "delivery",
  "date": "20151204",
  "data": {
    "sec": 36863,
    "status": "done"
  }
}

{
  "type": "picture",
  "orderId": "49269a16-479c-4531-8ffd-513b7ccd0621",
  "vehicleId": "0d8855e6-28a0-4e89-9c67-b44c66c39ba6",
  "orderStepType": "delivery",
  "date": "20151112",
  "data": {
    "id": "picture-1",
    "sec": 35427,
    "text": "Minor damage in lower left corner",
    "mime": "image/png",
    "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mNgYmICAAAQAAei1PI/AAAAAElFTkSuQmCC"
  }
}
Property Type Description
type enum One of timeIn, timeOut, detectedTimeIn, detectedTimeOut, statusUpdate, podSignature, podPicture, podAudio, podNote
orderId UUID Id of the Order. Together with orderStepType identifies the OrderStep this event applies to
orderStepType enum One of pickup or delivery. Together with orderId identifies the OrderStep this event applies to
date DateString Date of the event. Together with vehicleId identifies the Route this event applies to
vehicleId UUID Id of the Vehicle associated with this event. Together with date identifies the Route this event applies to
driverId UUID OR null Optional: Id of the Driver associated with this event, if known
clientTs long Optional: Timestamp of the event in seconds (Unix epoch) as recorded by the device (e.g.: mobile application)
data One of:
EEDataTimeIn
EEDataTimeOut
EEDataDetectedTimeIn
EEDataDetectedTimeOut
EEDataStatusUpdate
EEDataPodSignature
EEDataPodPicture
EEDataPodAudio
EEDataPodNote
Event data object. Object type varies based on the event type

EEDataTimeIn Object properties

{
  "sec": 35132,
  "latLng": [33817872, -87266893]
}
Property Type Description
sec int Reported time-in time, in seconds since midnight (e.g.: time-in at 6pm = 64800)
latLng LatLng OR null Optional: reported time-in coordinates.

EEDataTimeOut Object properties

{
  "sec": 35132,
  "latLng": [33817872, -87266893]
}
Property Type Description
sec int Reported time-out time, in seconds since midnight (e.g.: time-out at 6pm = 64800)
latLng LatLng OR null Optional: reported time-out coordinates

EEDataDetectedTimeIn Object properties

{
  "sec": 35132,
  "latLng": [33817872, -87266893]
}

Note: Use only if integrating with a custom mobile application implementing its own time-in auto-detection logic.

Property Type Description
sec int Auto-detected time-in time, in seconds since midnight (e.g.: time-in at 6pm = 64800)
latLng LatLng OR null Optional: detected time-in coordinates.

EEDataDetectedTimeOut Object properties

{
  "sec": 35132,
  "latLng": [33817872, -87266893]
}

Note: Use only if integrating with a custom mobile application implementing its own time-out auto-detection logic.

Property Type Description
sec int Auto-detected time-out time, in seconds since midnight (e.g.: time-out at 6pm = 64800)
latLng LatLng OR null Optional: auto-detected time-out coordinates

EEDataStatusUpdate Object properties

{
  "sec": 35132,
  "status": "done",
  "latLng": [33817872, -87266893]
}

Property Type Description
sec int Reported status-update time, in seconds since midnight (e.g.: update at 6pm = 64800)
status enum OR null Flags the Order as either reschedule (to be rescheduled at some later date/time) or done (marked as done).
Sending null as value removes any previous status
latLng LatLng OR null Optional: reported status-update coordinates

EEDataPodSignature Object properties

{
  "id": "customer",
  "sec": 36813,
  "text": "John Black",
  "mime": "image/png",
  "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mNgYmICAAAQAAei1PI/AAAAAElFTkSuQmCC"
}
Property Type Description
id enum One of customer or driver
sec int Reported signature time, in seconds since midnight (e.g.: signature at 6pm = 64800)
latLng LatLng OR null Optional: reported coordinates
text String OR null Optional: textual note attached to the signature image (e.g.: textual name/surname)
mime enum One of “image/png” or “image/jpeg”
data String Base64-encoded binary image data. Binary image format must match the provided mime type.
Set to null to remove the signature-type Proof of Delivery associated to the given id
LIMITS: Maximum base64-encoded size is 2_796_202 characters (2MB).

EEDataPodPicture Object properties

{
  "id": "picture-1",
  "sec": 35427,
  "text": "Minor damage in lower left corner",
  "mime": "image/png",
  "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mNgYmICAAAQAAei1PI/AAAAAElFTkSuQmCC"
}
Property Type Description
id enum Externally provided ID associated to the picture (useful to update or remove the picture at a later time)
sec int Reported picture time, in seconds since midnight (e.g.: picture at 6pm = 64800)
latLng LatLng OR null Optional: reported coordinates
text String OR null Optional: textual note attached to the picture image (e.g.: “package seal is broken”)
mime enum One of “image/png” or “image/jpeg”
data String Base64-encoded binary image data. Binary image format must match the provided mime type.
Set to null to remove the picture-type Proof of Delivery associated to the given id
LIMITS: Maximum base64-encoded size is 2_796_202 characters (2MB).

EEDataPodAudio Object properties

{
  "id": "audio-1",
  "sec": 37143,
  "text": "Example of clanking noise coming from left engine",
  "mime": "audio/aac",
  "data": "//FsQBUf/N4CAExhdmM1Ny42NS4xMDAAAdRlD8zvnW+a3jOON8SvPvdby...[truncated]"
}
Property Type Description
id enum Externally provided ID associated to the audio recording (useful to update or remove the audio at a later time)
sec int Reported time when the audio was recorded, in seconds since midnight (e.g.: audio recorded at 6pm = 64800)
latLng LatLng OR null Optional: reported coordinates
text String OR null Optional: textual note attached to the audio recording (e.g.: “example of clanking noise coming from left engine”)
mime enum One of “audio/mpeg” or “audio/aac”
data String Base64-encoded binary audio data. Binary audio format must match the provided mime type.
Set to null to remove the audio-type Proof of Delivery associated to the given id
LIMITS: Maximum base64-encoded size is 2_796_202 characters (2MB).

EEDataPodNote Object properties

{
  "sec": 35203,
  "text": "Best parking spot is 50mt ahead"
}
Property Type Description
sec int Reported note time, in seconds since midnight (e.g.: note at 6pm = 64800)
latLng LatLng OR null Optional: reported coordinates
text String Note text. Set to null to remove the note-type Proof of Delivery

Proposals objects

TimeSlot Object properties

{
  "timeWindows": [
    {
      "startSec": 46800,
      "endSec": 50400
    }
  ],
  "date": "20151204"
}
Property Type Description
timeWindows list of TimeWindow The list of TimeWindows for this slot.
LIMITS: cannot contain more than 4 TimeWindows
date DateString The eligible date for this slot.
LIMITS: must not be a past date

ProposalsSet Object properties

{
  "requestId": "f59d7e47-d67b-41a6-9cd4-fca9d481dec0",
  "requestStatus": "COMPLETED",
  "expiryTs": 1423047900,
  "order": {
    "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
    "name": "Order coming from Proposals API",
    "eligibility": {
      "type": "any"
    },
    "forceVehicleId": null,
    "priority": 0,
    "loads": {
      "pounds": 400
    },
    "delivery": {
      "location": {
        "address": "2001 2nd Ave, Jasper, AL 35501, USA"
      },
      "timeWindows": [],
      "notes": "Order for which we want to compute a set of proposals",
      "serviceTimeSec": 1800,
      "tagsIn": [],
      "tagsOut": [],
      "customFields": {
        "my custom field": "custom field content",
        "orderId": "abcd1234"
      }
    },
    "isService": false
  },
  "proposals": [
    {
      "status": "NOT_FOUND"
    },
    {
      "status": "FOUND",
      "data": {
        "routes": {
          "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203": {
            "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
            "revision": -1,
            "date": "20151204",
            "vehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
            "driverId": null,
            "steps": [
              {
                "type": "departure",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 0,
                "startSec": 0,
                "endSec": 28800,
                "driveToNextSec": 2918,
                "distanceToNextMt": 73402,
                "displayLabel": ""
              },
              {
                "type": "pickup",
                "orderId": "e2524914-3611-433b-9209-3ee59ee3996e",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 31718,
                "startSec": 31718,
                "endSec": 32318,
                "driveToNextSec": 2917,
                "distanceToNextMt": 73549,
                "displayLabel": ""
              },
              {
                "type": "delivery",
                "orderId": "deb5a845-40f8-42e0-963e-9646531894a4",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 35235,
                "startSec": 35235,
                "endSec": 36135,
                "driveToNextSec": 48,
                "distanceToNextMt": 334,
                "displayLabel": ""
              },
              {
                "type": "delivery",
                "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 38265,
                "startSec": 38265,
                "endSec": 40065,
                "driveToNextSec": 123,
                "distanceToNextMt": 846,
                "displayLabel": ""
              },
              {
                "type": "arrival",
                "idleTimeSec": 0,
                "perStopTimeSec": 0,
                "arrivalSec": 40188,
                "startSec": 40188,
                "endSec": 40188,
                "driveToNextSec": 0,
                "distanceToNextMt": 0,
                "displayLabel": ""
              }
            ]
          }
        },
        "orders": {
          "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7": {
            "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
            "name": "Order coming from Proposals API",
            "eligibility": {
              "on": "20151204"
           },
            "forceVehicleId": null,
            "priority": 0,
            "loads": {
              "pounds": 400
            },
            "delivery": {
              "location": {
                "address": "2001 2nd Ave, Jasper, AL 35501, USA"
              },
              "timeWindows": [
                {
                  "startSec": 46800,
                  "endSec": 50400
                }
              ],
              "notes": "Order for which we want to compute a set of proposals",
              "serviceTimeSec": 1800,
              "tagsIn": [],
              "tagsOut": [],
              "customFields": {
                "my custom field": "custom field content",
                "orderId": "abcd1234"
              }
            },
            "isService": false
          },
          "e2524914-3611-433b-9209-3ee59ee3996e": {
            "id": "e2524914-3611-433b-9209-3ee59ee3996e",
            "name": "Order 6",
            "eligibility": {
              "type": "any",
              "onDates": [
                "20151203"
              ]
            },
            "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
            "priority": 0,
            "loads": {
              "people": 400
            },
            "pickup": {
              "depotId": null,
              "location": {
                "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
                "latLng": [
                  33480873,
                  -86788220
                ],
                "status": "OK"
              },
              "timeWindows": [],
              "notes": "Demonstrate the concept of force a vehicle, apply different eligibility type",
              "serviceTimeSec": 600,
              "tagsIn": [],
              "tagsOut": [],
              "customFields": {}
            },
            "delivery": null,
            "isService": false
          },
          "deb5a845-40f8-42e0-963e-9646531894a4": {
            "id": "deb5a845-40f8-42e0-963e-9646531894a4",
            "name": "order2",
            "eligibility": {
              "type": "on",
              "onDates": [
                "20151205"
              ]
            },
            "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
            "priority": 0,
            "loads": {},
            "pickup": null,
            "delivery": {
              "depotId": null,
              "location": {
                "address": "33.833605,-87.277556",
                "latLng": [
                  33833604,
                  -87277556
                ],
                "status": "OK"
              },
              "timeWindows": [],
              "notes": "",
              "serviceTimeSec": 900,
              "tagsIn": [],
              "tagsOut": [],
              "customFields": {}
            },
            "isService": false
          }
        },
        "vehicles": {
          "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
            "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
            "idx": 2,
            "externalId": "Vehicle 2",
            "tracked": true,
            "color": "5500FF",
            "settings": {
              "20151203": {
                "available": true,
                "notes": "",
                "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "timeWindow": {
                  "startSec": 28800,
                  "endSec": 61200
                },
                "flexStartTime": true,
                "perStopCost": 0,
                "perStopTimeSec": 0,
                "maxWorkingTimeSec": 0,
                "maxDrivingTimeSec": 0,
                "maxDistanceMt": 0,
                "breaks": [],
                "loadCapacities": {
                  "people": 600
                },
                "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                "activationCost": 0,
                "drivingTimeCost": 2000,
                "idleTimeCost": 2000,
                "serviceTimeCost": 2000,
                "breakTimeCost": 2000,
                "kmCost": 100,
                "tags": [
                  "heavy"
                ],
                "speedFactor": 100
              },
              "20151204": {
                "available": true,
                "notes": "",
                "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "timeWindow": {
                  "startSec": 28800,
                  "endSec": 61200
                },
                "flexStartTime": true,
                "perStopCost": 0,
                "perStopTimeSec": 0,
                "maxWorkingTimeSec": 0,
                "maxDrivingTimeSec": 0,
                "maxDistanceMt": 0,
                "breaks": [],
                "loadCapacities": {
                  "people": 600
                },
                "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                "activationCost": 0,
                "drivingTimeCost": 2000,
                "idleTimeCost": 2000,
                "serviceTimeCost": 2000,
                "breakTimeCost": 2000,
                "kmCost": 100,
                "tags": [
                  "heavy"
                ],
                "speedFactor": 100
              },
              "20151205": {
                "available": true,
                "notes": "",
                "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
                "timeWindow": {
                  "startSec": 28800,
                  "endSec": 61200
                },
                "flexStartTime": true,
                "perStopCost": 0,
                "perStopTimeSec": 0,
                "maxWorkingTimeSec": 0,
                "maxDrivingTimeSec": 0,
                "maxDistanceMt": 0,
                "breaks": [],
                "loadCapacities": {
                  "people": 600
                },
                "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
                "activationCost": 0,
                "drivingTimeCost": 2000,
                "idleTimeCost": 2000,
                "serviceTimeCost": 2000,
                "breakTimeCost": 2000,
                "kmCost": 100,
                "tags": [
                  "heavy"
                ],
                "speedFactor": 100
              }
            }
          }
        },
        "depots": {
          "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
            "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
            "name": "TEST",
            "setupCost": -1,
            "setupTimeSec": -1,
            "location": {
              "address": "320 20th St W, Jasper, AL 35501, USA",
              "latLng": [
                33831316,
                -87278355
              ],
              "status": "OK"
            },
            "color": "998800"
          }
        },
        "drivers": {
          "a3935987-4944-462f-b602-4a3a12beeeff": {
            "id": "a3935987-4944-462f-b602-4a3a12beeeff",
            "name": "Driver 1",
            "email": "driver1@example.com"
          }
        }
      }
    },
    {
      "status": "NOT_FOUND"
    }
  ]
}
Property Type Description
requestId String ID associated to the request that generated this set; also doubles as the ID of the set.
requestStatus enum One of PENDING or COMPLETED
expiryTs long Expiry timestamp in seconds (Unix epoch).
The time this set of proposals expires if no proposal is applied
order Order Order associated with this result, the one we’ve computed proposals for.
Note: actual values for the Order’s eligibility and the target OrderStep’s timeWindows are finalized based on the applied proposal
proposals list of Proposal For each time slot in the Compute ProposalsSet request, describes the best Route assigment found (if any).
Note: the size of this array matches the size of the timeSlots array in the Compute ProposalsSet request

Proposal Object properties

{
  "status": "FOUND",
  "data": {
    "routes": {
      "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203": {
        "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
        "revision": -1,
        "date": "20151204",
        "vehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
        "driverId": null,
        "steps": [
          {
            "type": "departure",
            "idleTimeSec": 0,
            "perStopTimeSec": 0,
            "arrivalSec": 0,
            "startSec": 0,
            "endSec": 28800,
            "driveToNextSec": 2918,
            "distanceToNextMt": 73402,
            "displayLabel": ""
          },
          {
            "type": "pickup",
            "orderId": "e2524914-3611-433b-9209-3ee59ee3996e",
            "idleTimeSec": 0,
            "perStopTimeSec": 0,
            "arrivalSec": 31718,
            "startSec": 31718,
            "endSec": 32318,
            "driveToNextSec": 2917,
            "distanceToNextMt": 73549,
            "displayLabel": ""
          },
          {
            "type": "delivery",
            "orderId": "deb5a845-40f8-42e0-963e-9646531894a4",
            "idleTimeSec": 0,
            "perStopTimeSec": 0,
            "arrivalSec": 35235,
            "startSec": 35235,
            "endSec": 36135,
            "driveToNextSec": 48,
            "distanceToNextMt": 334,
            "displayLabel": ""
          },
          {
            "type": "delivery",
            "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
            "idleTimeSec": 0,
            "perStopTimeSec": 0,
            "arrivalSec": 38265,
            "startSec": 38265,
            "endSec": 40065,
            "driveToNextSec": 123,
            "distanceToNextMt": 846,
            "displayLabel": ""
          },
          {
            "type": "arrival",
            "idleTimeSec": 0,
            "perStopTimeSec": 0,
            "arrivalSec": 40188,
            "startSec": 40188,
            "endSec": 40188,
            "driveToNextSec": 0,
            "distanceToNextMt": 0,
            "displayLabel": ""
          }
        ]
      }
    },
    "orders": {
      "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7": {
        "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
        "name": "Order 6 - Proposal",
        "eligibility": {
          "on": "20151204"
       },
        "forceVehicleId": null,
        "priority": 0,
        "loads": {
          "people": 2
        },
        "delivery": {
          "location": {
            "address": "2001 2nd Ave, Jasper, AL 35501, USA"
          },
          "timeWindows": [
            {
              "startSec": 46800,
              "endSec": 50400
            }
          ],
          "notes": "Proposal order to be added via API",
          "serviceTimeSec": 1800,
          "tagsIn": [],
          "tagsOut": [],
          "customFields": {
            "my custom field": "custom field content",
            "orderId": "abcd1234"
          }
        },
        "isService": false
      },
      "e2524914-3611-433b-9209-3ee59ee3996e": {
        "id": "e2524914-3611-433b-9209-3ee59ee3996e",
        "name": "Order 6",
        "eligibility": {
          "type": "any",
          "onDates": [
            "20151203"
          ]
        },
        "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
        "priority": 0,
        "loads": {
          "people": 400
        },
        "pickup": {
          "depotId": null,
          "location": {
            "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
            "latLng": [
              33480873,
              -86788220
            ],
            "status": "OK"
          },
          "timeWindows": [],
          "notes": "Demonstrate the concept of force a vehicle, apply different eligibility type",
          "serviceTimeSec": 600,
          "tagsIn": [],
          "tagsOut": [],
          "customFields": {}
        },
        "delivery": null,
        "isService": false
      },
      "deb5a845-40f8-42e0-963e-9646531894a4": {
        "id": "deb5a845-40f8-42e0-963e-9646531894a4",
        "name": "order2",
        "eligibility": {
          "type": "on",
          "onDates": [
            "20151205"
          ]
        },
        "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
        "priority": 0,
        "loads": {},
        "pickup": null,
        "delivery": {
          "depotId": null,
          "location": {
            "address": "33.833605,-87.277556",
            "latLng": [
              33833604,
              -87277556
            ],
            "status": "OK"
          },
          "timeWindows": [],
          "notes": "",
          "serviceTimeSec": 900,
          "tagsIn": [],
          "tagsOut": [],
          "customFields": {}
        },
        "isService": false
      }
    },
    "vehicles": {
      "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
        "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
        "idx": 2,
        "externalId": "Vehicle 2",
        "tracked": true,
        "color": "5500FF",
        "settings": {
          "20151203": {
            "available": true,
            "notes": "",
            "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
            "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
            "timeWindow": {
              "startSec": 28800,
              "endSec": 61200
            },
            "flexStartTime": true,
            "perStopCost": 0,
            "perStopTimeSec": 0,
            "maxWorkingTimeSec": 0,
            "maxDrivingTimeSec": 0,
            "maxDistanceMt": 0,
            "breaks": [],
            "loadCapacities": {
              "people": 600
            },
            "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
            "activationCost": 0,
            "drivingTimeCost": 2000,
            "idleTimeCost": 2000,
            "serviceTimeCost": 2000,
            "breakTimeCost": 2000,
            "kmCost": 100,
            "tags": [
              "heavy"
            ],
            "speedFactor": 100
          },
          "20151204": {
            "available": true,
            "notes": "",
            "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
            "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
            "timeWindow": {
              "startSec": 28800,
              "endSec": 61200
            },
            "flexStartTime": true,
            "perStopCost": 0,
            "perStopTimeSec": 0,
            "maxWorkingTimeSec": 0,
            "maxDrivingTimeSec": 0,
            "maxDistanceMt": 0,
            "breaks": [],
            "loadCapacities": {
              "people": 600
            },
            "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
            "activationCost": 0,
            "drivingTimeCost": 2000,
            "idleTimeCost": 2000,
            "serviceTimeCost": 2000,
            "breakTimeCost": 2000,
            "kmCost": 100,
            "tags": [
              "heavy"
            ],
            "speedFactor": 100
          },
          "20151205": {
            "available": true,
            "notes": "",
            "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
            "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
            "timeWindow": {
              "startSec": 28800,
              "endSec": 61200
            },
            "flexStartTime": true,
            "perStopCost": 0,
            "perStopTimeSec": 0,
            "maxWorkingTimeSec": 0,
            "maxDrivingTimeSec": 0,
            "maxDistanceMt": 0,
            "breaks": [],
            "loadCapacities": {
              "people": 600
            },
            "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
            "activationCost": 0,
            "drivingTimeCost": 2000,
            "idleTimeCost": 2000,
            "serviceTimeCost": 2000,
            "breakTimeCost": 2000,
            "kmCost": 100,
            "tags": [
              "heavy"
            ],
            "speedFactor": 100
          }
        }
      }
    },
    "depots": {
      "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
        "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
        "name": "TEST",
        "setupCost": -1,
        "setupTimeSec": -1,
        "location": {
          "address": "320 20th St W, Jasper, AL 35501, USA",
          "latLng": [
            33831316,
            -87278355
          ],
          "status": "OK"
        },
        "color": "998800"
      }
    },
    "drivers": {
      "a3935987-4944-462f-b602-4a3a12beeeff": {
        "id": "a3935987-4944-462f-b602-4a3a12beeeff",
        "name": "Driver 1",
        "email": "driver1@example.com"
      }
    }
  }
}
Property Type Description
status enum One of FOUND, NOT_FOUND.
NOT_FOUND indicates that the Order could not be assigned to any Route in the given time slot
data RouteData Contains the single proposed best Route with all related data, or null if status is NOT_FOUND

RouteData Object properties

{
  "routes": {
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
      "revision": -1,
      "date": "20151204",
      "vehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "driverId": null,
      "steps": [
        {
          "type": "departure",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 0,
          "startSec": 0,
          "endSec": 28800,
          "driveToNextSec": 2918,
          "distanceToNextMt": 73402,
          "displayLabel": ""
        },
        {
          "type": "pickup",
          "orderId": "e2524914-3611-433b-9209-3ee59ee3996e",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 31718,
          "startSec": 31718,
          "endSec": 32318,
          "driveToNextSec": 2917,
          "distanceToNextMt": 73549,
          "displayLabel": ""
        },
        {
          "type": "delivery",
          "orderId": "deb5a845-40f8-42e0-963e-9646531894a4",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 35235,
          "startSec": 35235,
          "endSec": 36135,
          "driveToNextSec": 48,
          "distanceToNextMt": 334,
          "displayLabel": ""
        },
        {
          "type": "delivery",
          "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 38265,
          "startSec": 38265,
          "endSec": 40065,
          "driveToNextSec": 123,
          "distanceToNextMt": 846,
          "displayLabel": ""
        },
        {
          "type": "arrival",
          "idleTimeSec": 0,
          "perStopTimeSec": 0,
          "arrivalSec": 40188,
          "startSec": 40188,
          "endSec": 40188,
          "driveToNextSec": 0,
          "distanceToNextMt": 0,
          "displayLabel": ""
        }
      ]
    }
  },
  "orders": {
    "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7": {
      "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
      "name": "Order 6 - Proposal",
      "eligibility": {
        "on": "20151204"
     },
      "forceVehicleId": null,
      "priority": 0,
      "loads": {
        "people": 2
      },
      "delivery": {
        "location": {
          "address": "2001 2nd Ave, Jasper, AL 35501, USA"
        },
        "timeWindows": [
          {
            "startSec": 46800,
            "endSec": 50400
          }
        ],
        "notes": "Proposal order to be added via API",
        "serviceTimeSec": 1800,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {
          "my custom field": "custom field content",
          "orderId": "abcd1234"
        }
      },
      "isService": false
    },
    "e2524914-3611-433b-9209-3ee59ee3996e": {
      "id": "e2524914-3611-433b-9209-3ee59ee3996e",
      "name": "Order 6",
      "eligibility": {
        "type": "any",
        "onDates": [
          "20151203"
        ]
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {
        "people": 400
      },
      "pickup": {
        "depotId": null,
        "location": {
          "address": "1919 28th Ave S, Birmingham, AL 35209, United States",
          "latLng": [
            33480873,
            -86788220
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "Demonstrate the concept of force a vehicle, apply different eligibility type",
        "serviceTimeSec": 600,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "delivery": null,
      "isService": false
    },
    "deb5a845-40f8-42e0-963e-9646531894a4": {
      "id": "deb5a845-40f8-42e0-963e-9646531894a4",
      "name": "order2",
      "eligibility": {
        "type": "on",
        "onDates": [
          "20151205"
        ]
      },
      "forceVehicleId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "priority": 0,
      "loads": {},
      "pickup": null,
      "delivery": {
        "depotId": null,
        "location": {
          "address": "33.833605,-87.277556",
          "latLng": [
            33833604,
            -87277556
          ],
          "status": "OK"
        },
        "timeWindows": [],
        "notes": "",
        "serviceTimeSec": 900,
        "tagsIn": [],
        "tagsOut": [],
        "customFields": {}
      },
      "isService": false
    }
  },
  "vehicles": {
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7": {
      "id": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7",
      "idx": 2,
      "externalId": "Vehicle 2",
      "tracked": true,
      "color": "5500FF",
      "settings": {
        "20151203": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        },
        "20151204": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        },
        "20151205": {
          "available": true,
          "notes": "",
          "departureDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "arrivalDepotId": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
          "timeWindow": {
            "startSec": 28800,
            "endSec": 61200
          },
          "flexStartTime": true,
          "perStopCost": 0,
          "perStopTimeSec": 0,
          "maxWorkingTimeSec": 0,
          "maxDrivingTimeSec": 0,
          "maxDistanceMt": 0,
          "breaks": [],
          "loadCapacities": {
            "people": 600
          },
          "regionIds": ["ddcbe348-5b4d-483d-9d6c-1b149120ca7e"],
          "activationCost": 0,
          "drivingTimeCost": 2000,
          "idleTimeCost": 2000,
          "serviceTimeCost": 2000,
          "breakTimeCost": 2000,
          "kmCost": 100,
          "tags": [
            "heavy"
          ],
          "speedFactor": 100
        }
      }
    }
  },
  "depots": {
    "08f2f204-caf6-4b98-8767-9fd4e3b46307": {
      "id": "08f2f204-caf6-4b98-8767-9fd4e3b46307",
      "name": "TEST",
      "setupCost": -1,
      "setupTimeSec": -1,
      "location": {
        "address": "320 20th St W, Jasper, AL 35501, USA",
        "latLng": [
          33831316,
          -87278355
        ],
        "status": "OK"
      },
      "color": "998800"
    }
  },
  "drivers": {
    "a3935987-4944-462f-b602-4a3a12beeeff": {
      "id": "a3935987-4944-462f-b602-4a3a12beeeff",
      "name": "Driver 1",
      "email": "driver1@example.com"
    }
  }
}
Property Type Description
routes map[String] Route A map where the key is the routeId and the value is the associated Route object.
drivers map[String] Driver A map where the key is the driverId and the value is the associated Driver object. Includes Drivers referenced by the listed Routes (if any)
vehicles map[String] VehicleFull A map where the key is the vehicleId and the value is the associated Vehicle object. Includes Vehicles referenced by the listed Routes
orders map[String] Order A map where the key is the orderId and the value is the associated Order object. Includes Orders referenced by the listed Routes. It includes the Proposal Order.
depots map[String] Depot A map where the key is the depotId and the value is the associated Depot object. Includes Depots referenced by the listed Orders and Vehicles

GPS objects

GpsDevice Object properties

{
  "id": "40519",
  "label": "Green Van - SBA 1234A",
  "category": "PHYSICAL"
}
Property Type Description
id String GPS Device ID, as provisioned in WorkWave GPS
label String Label associated to the GPS Device, as provisioned in WorkWave GPS
category enum One of PHYSICAL, MOBILE.
PHYSICAL indicates vehicle-installed GPS units
MOBILE indicates smartphone units where the WorkWave Route Manager App is installed

GpsSample Object properties

{
  "id": "40519",
  "ts": 1449150077,
  "latLng": [
    33817872,
    -87266893
  ],
  "heading": 60,
  "speedMs": 7
}
Property Type Description
id String GPS Device ID associated to this sample
ts long Sample timestamp, in seconds (Unix epoch)
latLng LatLng Location coordinates of the device at the time the data was sampled
heading int Heading of the device at the time the data was sampled, in degrees. 0 represents north, 90 represents east and so forth

Notification data objects

OrdersChanged Object properties

{
  "created": [
    {
      "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
      "geocodeStatus": {
        "delivery": "OK"
      }
    },
    {
      "id": "89009ba2-285f-47a1-8b91-5524d8f31b16",
      "geocodeStatus": {
        "delivery": "LOW_ACCURACY"
      }
    },
    {
      "id": null,
      "geocodeStatus": {
        "delivery": "NOT_FOUND"
      }
    },
    {
      "id": "3d499ad0-14f6-4a38-acd8-05b8269dec78",
      "geocodeStatus": {
        "delivery": "POSTCODE_ISSUE"
      }
    },
    {
      "id": "a5682ad9-97e8-4719-9bb6-eecfcfb8606b",
      "geocodeStatus": {
        "delivery": "OK",
        "pickup": "LOW_ACCURACY"
      }
    }
  ],
  "updated": [
    {
      "id": "aee94205-c434-4e6e-b4a5-a9466c8f19ca",
      "geocodeStatus": {
        "delivery": "OK"
      }
    }
  ],
  "deleted": [
    "a784cb3a-429d-4f74-b5e5-3e9528f37917",
    "88c51466-87bf-4fa4-be8a-e0bf0eab586f"
  ]
}
Property Type Description
created list of ChangedOrder details about the newly added Orders
updated list of ChangedOrder details about the updated Orders
deleted list of UUID UUIDs of removed Orders

ChangedOrder Object properties

{
  "id": "aee94205-c434-4e6e-b4a5-a9466c8f19ca",
  "geocodeStatus": {
    "delivery": "OK"
  }
}

{
  "id": "a5682ad9-97e8-4719-9bb6-eecfcfb8606b",
  "geocodeStatus": {
    "delivery": "OK",
    "pickup": "LOW_ACCURACY"
  }
}

// Order with a delivery OrderStep that failed to be added because the address could not be geocoded
{
  "id": null,
  "geocodeStatus": {
    "delivery": "NOT_FOUND"
  }
}
Property Type Description
id UUID OR null UUID of added or updated Order, null for Orders that failed to be added
geocodeStatus map[Type]Status Type can be either pickup or delivery. Status is one of:
OK: success, and returned data indicates that the geocoded location is accurate
LOW_ACCURACY: success, but the location might not be accurate (e.g.: location on the correct street, but street number not found)
POSTCODE_ISSUE: success, but the postcode is either missing or does not match the one in the normalized address returned by the geocoding process
POSTCODE_LEVEL_ACCURACY: success, but the location is only accurate at the postcode level, not at the street level
OUT_OF_TERRITORY_RANGE: failure. Geocoding succeeded but the geocoded location is outside of the Territory’s area
NOT_FOUND: failure, address not found
GEOCODING_ERROR: failure, the geocoding service encountered a temporary error
GEOCODING_TIMEOUT: failure, the geocoding service took too long to respond
Note: Orders whose address cannot be geocoded are not added/updated.
For example, an Add Orders invocation adding 40 Orders where 5 fail to be geocoded will succeed but it will only add 35 Orders

ExecutionEventsProcessed Object properties

{
  "processed": [
    "OK",
    "OK",
    "ERROR_VEHICLE_NOT_TRACKED",
    "OK_WARN_LATLNG_OUT_OF_BOUNDS",
    "OK"
  ]
}
Property Type Description
processed List of ProcessedStatus Details about the ExecutionEvents that have been submitted.
ProcessedStatus is one of:
OK: the event was accepted and processed
OK_WARN_LATLNG_OUT_OF_BOUNDS: the event was accepted and processed, but the attached coordinates have been ignored because they fall outside of the Territory bounds
POSTPONED: the event was queued and will be processed at a later time. This happens when a user-initiated editing transaction is in progress. Under those circumstances all submitted ExecutionEvents are queued and processed as soon as the editing transaction completes
ERROR_NO_ORDER: the event was discarded because it references a non-existing Order
ERROR_NO_ORDER_STEP: the event was discarded because it references a non-existing OrderStep
ERROR_NO_VEHICLE : the event was discarded because it references a non-existing Vehicle
ERROR_VEHICLE_NOT_TRACKED: the event was discarded because it references a non-tracked Vehicle
ERROR_INVALID_EVENT_TYPE: the event was discarded because its type value is invalid

SchedulingCompleted Object properties

{
  "orderIds": [
    "603a348f-7fcc-4bdc-8f4a-ec10a68547e0"
  ],
  "orderSteps": [
    {
      "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
      "type": "delivery"
    }
  ]
}
Parameter Type Description
orderIds List of UUID List of affected Orders.
Only populated by Fit-in Unassigned Orders and Unassign Orders APIs. Not populated by Build Routes API
orderSteps List of OrderStepIdentifier List of affected OrdersSteps.
Only populated by the Assign an OrderStep API. Not populated by Build Routes API

ApprovedRoutesChanged Object properties

{
  "approved": [
    "20151204",
    "20151205"
  ],
  "revoked": [
    "20151206"
  ]
}
Property Type Description
approved list of DateString The list of dates where Routes have been approved, or where approval has been updated
revoked list of DateString The list of dates where Routes have been revoked approval

VehicleDriverAssignmentsChanged Object properties

{
  "requestId": "b32feaf9-5bbc-460a-9ee2-be68b9d648e4",
  "territoryId": "429defc8-5b05-4c3e-920d-0bb911a61345",
  "event": "vehicleDriverAssignmentsChanged",
  "data": {}
}

DriversChanged Object properties

{
  "created": [
    "0129724f-b80d-4011-ab91-3e4ae2f62896"
  ],
  "updated": [
    "a3935987-4944-462f-b602-4a3a12beeeff"
  ],
  "deleted": [
    "a08213e6-673f-4efc-955e-2bf587813162"
  ]
}
Property Type Description
created list of UUID UUIDs of created Drivers
updated list of UUID UUIDs of updated Drivers
deleted list of UUID UUIDs of deleted Drivers

VehiclesChanged Object properties

{
  "created": [
    "875cceab-0952-4101-9db3-e524dbec9a75"
  ],
  "updated": [
    "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7"
  ],
  "deleted": [
    "0d8855e6-28a0-4e89-9c67-b44c66c39ba6"
  ]
}
Property Type Description
created list of UUID UUIDs of created Vehicles
updated list of UUID UUIDs of updated Vehicles
deleted list of UUID UUIDs of deleted Vehicles

ProposalsSetProcessed Object properties

{
  "order": {
    "id": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
    "geocodeStatus": {
      "delivery": "OK"
    }
  },
  "proposals": [
    {
      "status": "NOT_FOUND"
    },
    {
      "status": "FOUND",
      "routeId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
      "startSec": 38265
    },
    {
      "status": "NOT_FOUND"
    }
  ]
}
Parameter Type Description
order ChangedOrder Details about the Order specified in the Compute ProposalsSet request, namely the assigned id and geocoding status(es)
proposals list of ProposalSummary Overview data for each computed proposal.
Note: Size and item sequence of this array match the timeSlots array in the Compute ProposalsSet request

ProposalSummary Object properties

{
  "status": "FOUND",
  "routeId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
  "startSec": 38265
}
Parameter Type Description
status enum One of FOUND or NOT FOUND
routeId String Shown only if status is FOUND. ID of the Route where there is the best insertion for the Order following current proposal (timewindows + eligibility)
startSec int Service start time for the proposal OrderStep

ProposalApplied Object properties

{
  "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
  "routeId": "31656f79-cba7-4bcf-a959-e3fe3f7ca2a7-20151203",
  "proposalIndex": 1
}
Parameter Type Description
orderId UUID ID assigned to the Order in the ProposalsSet
routeId UUID ID of the Route that the Order has been added to
proposalIndexApplied int Zero-based index of the applied proposal in proposals array of the ProposalsSet object

Miscellaneous objects

LatLng Object properties

// Coords for the Arena in Verona, Italy
// https://www.google.com/maps/@45.439,10.994428,20z
[45439000, 10994428]

// Coords for St. Paul's Cathedral, London, UK
// https://www.google.com/maps/@51.513753726152,-0.098655,20z
[51513753, -98655]

[lat, lng] where lat and lng are computed as WGS-84 decimal coords * 1_000_000, rounded down to the nearest integer value.

Example #1:

Example #2:

DateString Object properties

// December 15, 2015
"20151215"

Date represented as a string formatted as yyyyMMdd.

Location Object properties

{
  "address": "3101 Florida Ave, Jasper, AL 35501, USA",
  "latLng": [
    33817872,
    -87266893
  ],
  "status": "OK"
}
Property Type Description
address String The full address, as provided
latLng LatLng The coordinates for the address
status enum Accuracy status computed during the geocoding process.
One of OK, LOW_ACCURACY, POSTCODE_ISSUE, POSTCODE_LEVEL_ACCURACY
If no geocode took place (e.g.: because coordinates were already provided along with the address) then status=OK
geoAddress String OR null The normalized address returned by the geocoding process

LocationInput Object properties

Address only: geocoding is performed to get the map coordinates together with an “accuracy” status

{
  "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA"
}

Address + coordinates: no geocoding takes place, the address is treated as a plain string and the “accuracy” status is assumed to be OK

{
  "address": "3101-3199 Florida Ave, Jasper, AL 35501, USA",
  "latLng": [33817872, -87266893]
}
Property Type Description
address String Mandatory: the full address, properly formatted as per postal service directives, and without additional non-standard details like apartment number, suite number and other notes
latLng LatLng Optional: the coordinates of the address. If left empty, the address is geocoded to retrieve its coordinates.
Note that geocoding cannot be guaranteed to always be 100% exact. For example, addresses for newly built roads that have not yet been added to our maps may fail to be geocoded or return “best-effort” coordinates. Wrongly formatted or partial addresses will also unlikely translate to precise coordinates

TimeWindow Object properties

{
  "startSec": 30600,
  "endSec": 37800
}
Property Type Description
startSec int Start of the time window in seconds since midnight
endSec int End of the time window in seconds since midnight. Must be >= startSec

Break Object properties

{
  "durationSec": 3600,
  "startSec": 28000,
  "endSec": 28800
}
Property Type Description
durationSec int Break duration in seconds
startSec int Earliest time when the break can start, in seconds since midnight
endSec int Latest time when the break can start, in seconds since midnight. Must be >= startSec

Eligibility Object properties

Eligible to be served on December 4 or December 5, 2015

{
  "type": "on",
  "onDates": [
    "20151204",
    "20151205"
  ]
}

Eligible to be served up to and including December 15 2015

{
  "type": "by",
  "byDate": [
    "20151215"
  ]
}

Eligible to be served on any date

{
  "type": "any"
}
Property Type Description
type enum One of on, by, any
byDate DateString Used when type = by
onDates list of DateString Used when type = on

OrderStepIdentifier Object properties

{
  "orderId": "fb5e269b-9a16-4d44-abe5-a3f1c84acdb7",
  "type": "delivery"
}
Parameter Type Description
orderId UUID Id of the Order. Together with type identifies the OrderStep
type enum One of pickup or delivery.
Note: OrderSteps belonging to “service” Orders (orders flagged with “isService=true”. See also the description of Order.isService) will have type=delivery

ErrorResponse Object properties

{
  "errorCode": 600,
  "errorMessage": "Adding 75 Orders to the existing 980 exceeds the maximum of 1000 allowed for operations on territory [New York]"
}
Property Type Description
errorCode int One of the error codes listed here
errorMessage String A human-readable message providing additional details about the error

Revision History

Date (Y/M/D) Description
 
2017/09/07 Added pseudocode exemplifing how to verify a signed callback.
See examples at Set Callback URL
Clarified that deleting one OrderStep from a pickup&delivery Order triggers an update order notification, not a delete one.
See examples at Delete an OrderStep
2017/08/03 Clarified routeIds property in BestFit request, clarified to/from limits in BestFit and BuildRoutes requests.
2017/05/24 Added a new “Proposals” set of API (experimental).
See the Proposals API set overview and the new Proposals API section.
2017/05/19 Added support for sending detected time-in and detected time-out Proof-of-Delivery (POD) items.
These two new POD types are intended to be used by customers implementing their own Mobile Application and requiring full control over all aspects of Event Tracking.
See updated Execution Event
2017/05/10 Fixed incorrect references and a couple of broken links
2017/01/26 Added support for sending audio-recording Proof-of-Delivery (POD) items.
See updated Execution Event and Audio POD object
Documented safe querystrings size limits on relevant methods.
See Get Orders and Delete Orders
Documented missing limitations on binary Proof Of Delivery items (images, pictures and audio recordings).
See Signature POD object, Picture POD object and Audio POD object
2017/01/13 Clarified that tags and load names can only be lowercase and are lowercased on input.
See OrderInput, OrderStepInput and VehicleSettings
2016/12/27 Added timeInDetected and timeOutDetected fields to the TrackingData Object.
See TrackingData Object
Added clarifications on how time-in, time-out, status-update and proof-of-delivery events are taken into account when updating ETAs of yet-to-be-serviced Orders.
See Send Execution Events
2016/12/14 Added support for assigning an OrderStep to a Route at a given position.
See Assign an OrderStep and SchedulingCompleted Object
2016/11/22 Documented missing limitations in OrderInput, OrderStepInput and VehicleSettings Objects.
See OrderInput, OrderStepInput and VehicleSettings
2016/09/22 Fixed incorrect references. Order Object pickup and delivery properties now correctly listed as OrderStep-type Objects
Consistency: renamed objects InputOrder to OrderInput and InputDriver to DriverInput (no impact on existing integrations)
2016/09/15 Fixed incorrect URL at List Current GPS Info
2016/07/20 Fixed incorrect example and non-working link at Approve Routes
2016/06/27 Added support for Time Window Exceptions. OrderStep Object now includes a timeWindowExceptions field.
See the OrderStep Object
2016/06/18 Added a new “GPS Tracking” set of API. See here and here.
Drivers can now be associated to a GPS Device. Driver and Vehicle Objects now include a gpsDeviceId field.
See DriverInput Object, Driver Object and Vehicle Object
2016/05/10 Added support for a new VehicleSettings constraint maxDistanceMt. VehicleSettings Object now includes a maxDistanceMt field
2016/05/03 Add Orders API now supports a acceptBadGeocodes property that, when set to true, allows all Orders to be added to the plan, regardless of the outcome of the geocoding process. Orders with an invalid address can be later manually reviewed/fixed from the Web Application. See Add Orders
2016/04/20 Added support for editing Vehicle settings, including availability. Introduces a new asynchronous notification.
See Replace Vehicle Settings and VehiclesChanged Notification
Added support for overriding UI-defined locked Routes in Build Routes and Fit-In API.
See lockedRouteIdsOverride in Build Routes and overrideLockedRoutes in Fit-In Unassigned Orders
Added support for CRUD operations on Drivers. Introduces a new asynchronous notification.
See Drivers API and DriversChanged Notification
Added a new “Vehicle-Driver Assignments” set of API. Introduces a new asynchronous notification.
See Vehicle-Driver Assignments API and VehicleDriverAssignmentsChanged Notification
Added Approve Routes and Revoke Routes API. Introduces a new asynchronous notification.
See Approve Routes, Revoke Routes and ApprovedRoutesChanged Notification
Added List Regions API. VehicleSettings Object now includes a regionIds field.
See List Regions and VehicleSettings
Fixed requestId property not being set to null on asynchronous notifications triggered by manual operations performed via the Web Application
Fixed error codes returned by failed validation checks on ReplaceOrders, BestFit and BuildRoutes APIs (returned errorCode 400 instead of 100)
2016/04/11 Added a new Replace Orders API. See Replace Orders
2016/04/08 Add Orders API now supports a strict property that, when set to false, ignores invalid Orders without causing the whole request to fail. See Add Orders
Added support for testing the callback URL. See the new test property at Set Callback URL
Added support for signing the the callback URL. See the new signaturePassword property at Set Callback URL
2016/03/09 Added List Drivers API
2016/02/29 Documentation migrated to HTML format. Fixed typos and errors in JSON example data. Added per-object JSON examples
2016/02/26 Updated the documentation to reflect the new product name (Fleet renamed to Route Manager). No functional changes have been introduced
2016/01/29 Clarified how Add Orders behaves in case of validation errors. See Add Orders
Relaxed throttling limits on List Approved Routes, Get Approved Route, List Current Routes, Get Current Route
2016/01/05 Added support for sending and retrieving Proof-of-Delivery (POD) items.
Retrieving PODs: see Download a Proof of Delivery. New pods field in TrackingData, new objects here and here
Sending PODs: see Send Execution Events, updated Execution Event, new objects here, here and here
2015/12/22 List Current Routes and List Approved Routes can now retrieve data from archived dates
2015/12/18 Improved documentation of query string parameters
2015/12/17 Improved JSON examples and fixed Add Orders request example (Single Order)
2015/11/13 Added Request/Response JSON examples
2015/11/11 Fixed description of the depot property in List Orders and Get Orders
2015/11/02 Added a new “Scheduling” set of API. See Scheduling API
2015/10/23 Added SendExecutionEvent API
2015/10/16 Implemented missing Replace an Order and Replace an OrderStep APIs.
Updated Depot, Vehicle and VehicleFull objects to include the color property.
Updated the include filter of the List Orders API to accept aliases of served/unserved: assigned/unassigned
2015/10/15 Fixed incorrect endpoint URLs
2015/09/29 Improved descriptions at Object Definitions
Removed a Chapter documenting a feature not yet available
2015/09/23 Added clarifications about service-type Orders here, here and here
2015/08/31 First public revision