• 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

    Insert Jobs

    • POST https://routecloud.telogis.com/v1/insert.
    • Authentication required.
    • Request body: insert_request.
    • Response body: If wait=1 specified, returns the task result (see below). Otherwise, returns a task_redirect_response.
    • Task result: If return_request is true, returns a problem. Otherwise, returns an insert_response.

    The insert jobs operation inserts a list of jobs into routes without changing the sequencing of the existing jobs.

    Query Parameters

    • wait=1 - Optional. Wait until the insert completes before returning the result. See Retrieving API Results.

    Status Codes

    • 200 - Success.
    • 302 - If wait=1 was provided and the insert result is not yet available, a redirect is sent instead of a normal result every 15 seconds to refresh the HTTP timeout. See Retrieving API Results.
    • 400 - The input problem is invalid. The response is an error_response.
    • 401 - Authentication required.
    • 429 - Exceeded usage limits.

    insert_request

    The insert_request type inherits all fields from problem.

    Name Type Description
    allow_hard_constraint_violations boolean Defines if hard constraints should be ignored when inserting jobs. Defaults to false.
    custom custom Inherited. User-supplied custom fields that are returned unmodified in the response. These have no effect on optimization.
    drivers driver[] Inherited. If specified, the drivers involved in this request.
    id string Inherited. An identifier for the request. See Request IDs.
    jobs_to_insert job[] The jobs to be inserted.
    markers *marker[] Inherited*. The markers involved in this request. If defined here, markers can be referenced by id elsewhere; for example, job.location.
    name string Inherited. A name for the request. See Request IDs.
    return_request boolean Defines if the original request, with calculated values, is returned as the response. If not, an Insert Response is returned. See Full vs Partial Responses. Defaults to false.
    routes route[] Inherited. Routes to insert the jobs into.
    schedules schedule[] Inherited. If specified, applies recurring schedule constraints to the jobs.
    settings settings Inherited. Settings to apply during the insert call.
    vehicles vehicle[] The vehicles involved in this optimization problem. If defined here, vehicles can be referenced by id elsewhere; for example, route.vehicle.
    {
      "id": "request+1234567",
      "name": "territory1",
      "routes": [
        {
          "id": "route0",
          "location": "39.718005, -104.969531",
          "start_time": "09:00",
          "jobs": [
            { "id": "job0", "time_on_site": "00:15", "location": "39.590789, -105.084376" },
            { "id": "job1", "time_on_site": "00:10", "location": "39.597111, -105.041015" }
          ]
        }, {
          "id": "route1",
          "location": "39.718005, -104.969531",
          "start_time": "09:00",
          "jobs": [
            { "id": "job2", "time_on_site": "00:10", "location": "39.749546, -105.069141" },
            { "id": "job3", "time_on_site": "00:10", "location": "39.727919, -105.103126" }
          ]
        }
      ],
      "jobs_to_insert": [
        { "id": "job_to_insert1", "time_on_site": "00:10", "location": "39.820688, -105.133594" },
        { "id": "job_to_insert2", "time_on_site": "00:15", "location": "39.825626, -105.130460" },
        { "id": "job_to_insert3", "location": "39.825626, -105.130460", "required_route_attributes": ["unsatisfiable"] }
      ],
      "allow_hard_constraint_violations": false
    }
    

    An example insert request.

    insert_response

    Note

    The result of an insert is a problem instead of an insert_response, if return_request was set to true on the input.

    The insert_response type inherits all fields from problem_response.

    Name Type Description
    custom custom Inherited. User-supplied custom fields that were sent in the request.
    routes route_response[] Inherited. Routes with jobs inserted.
    schedules schedule_response[] Inherited. Schedules that had their base dates assigned, if any. See Routing with Schedules.
    unrouted_jobs stop_response[] Inherited. Jobs that could not be routed.
    {
      "routes": [
        {
          "id": "route0", ...
          "stops": [
            { "type": "depot", ... },
            { "id": "job0", ... },
            { "id": "job1", ... },
            { "type": "depot", ... }
          ]
        },
        {
          "id": "route1",
          "stops": [
            { "type": "depot", ... },
            { "id": "job2", ... },
            { "id": "job_to_insert1", ... },
            { "id": "job_to_insert2", ... },
            { "id": "job3", ... },
            { "type": "depot", ... }
          ]
        }
      ],
      "unrouted_jobs": [
        { "id": "job_to_insert3" }
      ]
    }
    

    An example insert response.

    See Also

    • Inserting Jobs.