Solution
Contains the actual solution, once solved.
curl --request GET \
--url https://api.solvice.io/v2/vrp/jobs/{id}/solution \
--header 'Authorization: <api-key>'import requests
url = "https://api.solvice.io/v2/vrp/jobs/{id}/solution"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.solvice.io/v2/vrp/jobs/{id}/solution', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.solvice.io/v2/vrp/jobs/{id}/solution",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.solvice.io/v2/vrp/jobs/{id}/solution"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.solvice.io/v2/vrp/jobs/{id}/solution")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.solvice.io/v2/vrp/jobs/{id}/solution")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"trips": [
{
"visits": [
{
"arrival": "2022-03-10T12:15:50-04:00",
"serviceTime": 123,
"travelTime": 123,
"distance": 123,
"job": "<string>",
"activity": "<string>",
"location": {
"latitude": 123,
"longitude": 123,
"h3Index": 123
},
"latlon": [
123
],
"snappedLocation": {
"latitude": 123,
"longitude": 123,
"h3Index": 123
},
"breakTime": 123,
"waitTime": 123
}
],
"resource": "<string>",
"date": "<string>",
"departureTime": "<string>",
"waitTime": 123,
"travelTime": 123,
"workTime": 123,
"serviceTime": 123,
"polyline": "<string>",
"occupancy": 123,
"start": {
"job": "Job-1",
"arrival": "2023-01-13T08:30:00Z",
"serviceTime": 600,
"travelTime": 1800,
"distance": 15000,
"activity": "service",
"location": {
"latitude": 51.0543,
"longitude": 3.7174
},
"breakTime": 0,
"waitTime": 0
},
"end": {
"job": "Job-1",
"arrival": "2023-01-13T08:30:00Z",
"serviceTime": 600,
"travelTime": 1800,
"distance": 15000,
"activity": "service",
"location": {
"latitude": 51.0543,
"longitude": 3.7174
},
"breakTime": 0,
"waitTime": 0
},
"distance": 123
}
],
"id": "<string>",
"status": "SOLVED",
"score": {
"hardScore": 123,
"mediumScore": 123,
"softScore": 123,
"feasible": true
},
"unresolved": "<unknown>",
"totalWaitTimeInSeconds": 123,
"occupancy": 123,
"totalTravelDistanceInMeters": 123,
"totalTravelTimeInSeconds": 123,
"totalServiceTimeInSeconds": 123,
"unserved": [
"<string>"
],
"unservedReasons": {},
"suggestions": [
{
"score": {
"hardScore": 123,
"mediumScore": 123,
"softScore": 123,
"feasible": true
},
"assignments": [
{
"job": "<string>",
"resource": "<string>",
"executedAfter": "<string>",
"suggestedArrival": "<string>",
"latestArrival": "<string>",
"score": {
"hardScore": 123,
"mediumScore": 123,
"softScore": 123,
"feasible": true
},
"scoreExplanation": {
"score": "<string>"
},
"suggestedInitialArrival": "2022-03-10T12:15:50-04:00",
"violations": [
{
"score": "<string>"
}
]
}
]
}
],
"messages": [
"<string>"
],
"estimatedCost": {
"totalCostEur": 450.75,
"travelTimeCostEur": 125.5,
"distanceCostEur": 87.5,
"waitTimeCostEur": 15,
"laborCostEur": 200,
"activationCostEur": 50,
"penaltyCostEur": 27.25
},
"violations": [
{
"name": "<string>",
"value": 123,
"level": "[HARD, MEDIUM, SOFT]"
}
],
"workloadFairness": 123
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Api Key based authentication (apikey)
Path Parameters
Response
Status
OnRoute response from solve
Actual solution: trips per shift/day and per resource
Show child attributes
Show child attributes
Id of the solve job
"0000-00000-00000-0000"
Status of the solve job.
ERROR, QUEUED, SOLVING, SOLVED "SOLVED"
The score of a solution shows how good this solution is w.r.t all the constraints. All solvers try to maximize the score.
Show child attributes
Show child attributes
Constraints that are violated
Wait time for all resources
123
How full this schedule is in terms of work time (incl travel) over capacity. Eg 80%
0.8
Travel distance for all resources in meters
123
Travel time for all resources
123
Service time for all resources
123
Unserved jobs
"[job-1]"
Reasons why jobs could not be served, mapped by job name
Show child attributes
Show child attributes
{
"job-1": [
"DATE_TIME_WINDOW_CONFLICT",
"TRIP_CAPACITY"
]
}
List of suggested assignments returned by suggest api call
Show child attributes
Show child attributes
Events and warnings generated during the solver execution
Financial cost breakdown of the optimized solution. Only populated when costs configuration is provided in the request.
Show child attributes
Show child attributes
{
"totalCostEur": 450.75,
"travelTimeCostEur": 125.5,
"distanceCostEur": 87.5,
"waitTimeCostEur": 15,
"laborCostEur": 200,
"activationCostEur": 50,
"penaltyCostEur": 27.25
}
Show child attributes
Show child attributes
Was this page helpful?
curl --request GET \
--url https://api.solvice.io/v2/vrp/jobs/{id}/solution \
--header 'Authorization: <api-key>'import requests
url = "https://api.solvice.io/v2/vrp/jobs/{id}/solution"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.solvice.io/v2/vrp/jobs/{id}/solution', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.solvice.io/v2/vrp/jobs/{id}/solution",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.solvice.io/v2/vrp/jobs/{id}/solution"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.solvice.io/v2/vrp/jobs/{id}/solution")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.solvice.io/v2/vrp/jobs/{id}/solution")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"trips": [
{
"visits": [
{
"arrival": "2022-03-10T12:15:50-04:00",
"serviceTime": 123,
"travelTime": 123,
"distance": 123,
"job": "<string>",
"activity": "<string>",
"location": {
"latitude": 123,
"longitude": 123,
"h3Index": 123
},
"latlon": [
123
],
"snappedLocation": {
"latitude": 123,
"longitude": 123,
"h3Index": 123
},
"breakTime": 123,
"waitTime": 123
}
],
"resource": "<string>",
"date": "<string>",
"departureTime": "<string>",
"waitTime": 123,
"travelTime": 123,
"workTime": 123,
"serviceTime": 123,
"polyline": "<string>",
"occupancy": 123,
"start": {
"job": "Job-1",
"arrival": "2023-01-13T08:30:00Z",
"serviceTime": 600,
"travelTime": 1800,
"distance": 15000,
"activity": "service",
"location": {
"latitude": 51.0543,
"longitude": 3.7174
},
"breakTime": 0,
"waitTime": 0
},
"end": {
"job": "Job-1",
"arrival": "2023-01-13T08:30:00Z",
"serviceTime": 600,
"travelTime": 1800,
"distance": 15000,
"activity": "service",
"location": {
"latitude": 51.0543,
"longitude": 3.7174
},
"breakTime": 0,
"waitTime": 0
},
"distance": 123
}
],
"id": "<string>",
"status": "SOLVED",
"score": {
"hardScore": 123,
"mediumScore": 123,
"softScore": 123,
"feasible": true
},
"unresolved": "<unknown>",
"totalWaitTimeInSeconds": 123,
"occupancy": 123,
"totalTravelDistanceInMeters": 123,
"totalTravelTimeInSeconds": 123,
"totalServiceTimeInSeconds": 123,
"unserved": [
"<string>"
],
"unservedReasons": {},
"suggestions": [
{
"score": {
"hardScore": 123,
"mediumScore": 123,
"softScore": 123,
"feasible": true
},
"assignments": [
{
"job": "<string>",
"resource": "<string>",
"executedAfter": "<string>",
"suggestedArrival": "<string>",
"latestArrival": "<string>",
"score": {
"hardScore": 123,
"mediumScore": 123,
"softScore": 123,
"feasible": true
},
"scoreExplanation": {
"score": "<string>"
},
"suggestedInitialArrival": "2022-03-10T12:15:50-04:00",
"violations": [
{
"score": "<string>"
}
]
}
]
}
],
"messages": [
"<string>"
],
"estimatedCost": {
"totalCostEur": 450.75,
"travelTimeCostEur": 125.5,
"distanceCostEur": 87.5,
"waitTimeCostEur": 15,
"laborCostEur": 200,
"activationCostEur": 50,
"penaltyCostEur": 27.25
},
"violations": [
{
"name": "<string>",
"value": 123,
"level": "[HARD, MEDIUM, SOFT]"
}
],
"workloadFairness": 123
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}