v15

latestOpenAPI 3.1.02026-07-1295183803.5 KB
Optimization

Flexible POST

post/optimization/v2

Query parameters

keystring 32 character alphanumeric string required
Example:key=API_KEY

A key is a unique identifier that is required to authenticate a request to the API.

Request body

descriptionstring

Define the optimization job using any custom message. This description is returned as is in the response.

existing_solution_idstring

The previous optimization request id used to retrieve solution for reoptimization

Example request

{
  "jobs": [
    {
      "id": "\"id\":\"Job 1\""
    }
  ],
  "shipments": [
    {
      "pickup": {
        "id": "\"id\": \"Shipment Pickup 1\""
      },
      "delivery": {
        "id": "\"id\":\"Shipment Delivery 1\""
      }
    }
  ],
  "depots": [
    {
      "id": "\"id\":\"depot 1\"",
      "description": "“description”:”Los_Angeles_depot”"
    }
  ],
  "options": {
    "objective": {
      "travel_cost": "\"travel_cost\": \"distance\""
    },
    "routing": {
      "mode": "\"mode\": \"truck\"",
      "truck_size": "\"truck_size\":\"200,210,600\"",
      "avoid": [
        "“avoid”: [\n“bbox:34.0635,-118.2547, 34.0679,-118.2478” ,\n“bbox:34.0521,-118.2342, 34.0478,-118.2437”,\n“highway”\n]"
      ],
      "context": "\"context\" : \"avgspeed\""
    }
  },
  "solution": [
    {
      "steps": [
        {
          "type": "\"type\": \"pickup\"",
          "id": "\"id\": \"Job 10\""
        }
      ],
      "geometry": "\"geometry\": \"}ebGgcsxRE?CuDOYCYAG???\""
    }
  ],
  "description": "\"description\": \"Sample Optimization\"",
  "relations": [
    {
      "type": "\"type\": \"in_direct_sequence\"",
      "steps": [
        {
          "type": "\"type\": \"job\"",
          "id": "\"id\":\"Job 1\""
        }
      ],
      "vehicle": "\"vehicle\": \"Vehicle 10\""
    }
  ]
}

Response

idstring

A unique ID which can be used in the Optimization GET method to retrieve the result of optimization.

messagestring

Displays an acknowledgement message once the job is submitted.

statusstring

A string indicating the state of the response. On successful responses, the value will be Ok. Indicative error messages/codes are returned in case of errors. See the API Error Codes section below for more information.

warningsstring[]

Display the warnings for the given input parameters, values and constraints.