Created
December 17, 2018 22:29
-
-
Save afian/c4c309f47cc29e95b78bd82683166995 to your computer and use it in GitHub Desktop.
Synchronous Routific API call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var params = { | |
visits: { | |
visit_1: { | |
location: { | |
name: "Jack Smith", | |
lat: 49.227607, | |
lng: -123.1363085 | |
}, | |
start: "8:00", | |
end: "16:00", | |
duration: 10 | |
}, | |
visit_2: { | |
location: { | |
name: "Bill Mayers", | |
lat: 49.227607, | |
lng: -123.1363085 | |
}, | |
start: "8:00", | |
end: "16:00", | |
duration: 10 | |
}, | |
visit_3: { | |
location: { | |
name: "Marc Kuo", | |
lat: 49.227607, | |
lng: -123.1363085 | |
}, | |
start: "8:00", | |
end: "16:00", | |
duration: 10 | |
} | |
}, | |
fleet: { | |
vehicle_1: { | |
start_location: { | |
id: "depot", | |
lat: 49.2553636, | |
lng: -123.0873365 | |
} | |
} | |
} | |
} | |
$.ajax({ | |
type:"POST", | |
url:"http://api.routific.com/v1/vrp", | |
headers: { | |
'Authorization':'bearer [add your token here]', | |
'Content-Type':'application/json' | |
}, | |
dataType: 'json', | |
data: JSON.stringify(params), | |
success: function(data) { | |
console.log(data); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment