• Home
  • Guides
  • Reference
  • Support

    Show / Hide Table of Contents
    • API Overview
      • Overview
      • Authentication
      • Retrieving API Results
      • Referenced vs Inline Entities
      • Choosing API Response Data
      • Handling API Errors
    • separator
    • Vehicle Routing Endpoints
      • Path
    • Optimization Endpoints
      • Instantiate
      • Build
      • Assignment Restrictions
      • Optimize
      • Sequence
      • Evaluate
      • Recommend
      • Insert
      • Centroids
      • Zones
      • Consolidate By Job Restrictions
      • Consolidate By Route Assignments
    • Geocoding Endpoints
      • Geocode
      • Reverse Geocode
    • Task Endpoints
      • List
      • Status
      • Result
      • Cancel
    • Sandbox Endpoints
      • List
      • Create
      • Rename
      • Retrieve
      • Update
      • Delete
      • Revisions
      • Add Revision
      • Expiry
      • Permissions
    • Verizon Connect Fleet Integration Endpoints
      • Pull Platform Data
      • Sync Platform Data
      • List Platform Territories
    • Other Endpoints
      • Canonicalize
      • Route Cards
      • Validate
      • Version
    • separator
    • Request Types
      • problem
      • capacity_metric
      • depot
      • driver
      • driver_break
      • job
      • job_template
      • job_type
      • load_amount
      • marker
      • problem_defaults
      • route
      • schedule
      • settings
      • shift
      • shift_override
      • shift_pattern
      • shift_pattern_assignment
      • stop
      • vehicle
      • zone
      • variance
    • Response Types
      • instantiate_response
      • problem_response
      • problem_aggregates
      • driver_response
      • geocoded_location
      • recommend_option
      • route_response
      • schedule_response
      • schedule_instantiate_response
      • stop_response
      • violation
    • Meta Types
      • task_redirect_response
      • task_status_response
      • validate_response
    • Sandbox Types
      • delta
      • array_delta
      • dict_delta
      • keyed_array_delta
      • object_delta
      • set_delta
      • revision
      • revision_created_response
      • revision_response
      • sandbox_response
    • Common Types
      • date_range
      • day_of_week
      • hazmat_load_type
      • id
      • latlon
      • stop_type
      • time_window
      • custom
      • polygon
    • Primitive Types
      • boolean
      • date
      • datetime
      • float
      • integer
      • string
      • timespan

    array_delta

    An array_delta is a type of delta that modifies an array. This type of $collection should be used when array order is important. One and only one of replace, insert, set, or remove must be specified. The array is created if it does not yet exist.

    The route.jobs field can only be modified using the replace, insert, or remove fields. The schedule.jobs field can be modified by using the set field only.

    Name Type Description
    $collection string Required. Must be "array" for an array_delta.
    $path string Required on top-level deltas. The JSON path to modify. See Paths for a list of valid paths.
    index integer Optional. The index where the insert operation is performed at.
    insert any[] Optional. Insert values into the existing array at index.
    remove any[] Optional. Remove existing values that match these selectors; for example, "job1" or { "id": "job1" }.
    replace any[] Optional. Replace the existing array with a new array.
    set array_index_setter[] Optional. Set specific indexes of the existing array.

    array_index_setter

    Name Type Description
    index integer Required. The index where the set operation is performed at. If higher than the length of the array, the array is padded with nulls.
    value any Required. The element at index is set to this value.

    route.jobs Unique Values

    Any modification to route.jobs moves jobs. That is, before the insert, remove or replace is performed, the jobs are first removed from their current positions. This ensures that jobs are never duplicated on multiple routes.

    Examples

    A revision using an array_delta to insert two jobs into a route:

    {
      "deltas": [{
        $path: ["route", { id: "route0" }, "jobs"],
        $collection: "array",
        index: 3,
        insert: [ "job3", "job5", "job7" ],
      }]
    }
    

    A revision creating a job and using an array_index_setter to make it the 12th job (ordinal 11) in the schedule:

    {
      "deltas": [{
        "$path": ["job"],
        "$collection": "keyed_array",
        "ids": ["job2"]
        "assign": {
          location: "marker1",
          time_on_site: "00:10:00",
        }
      }, {
        "$path": ["schedule", { id: "schedule0" }, "jobs"],
        "set": [{
          "index": 11,
          "value": "job2"
        }]
      }]
    }
    

    See Also

    • delta.
    • Sandboxes.