Current SDK do not support this service.
So you need to use axios/XMLHttpRequest to send the request.
axios example:
let data = {
"waypoints": [
{
"point": {
"latitude": 45.458546,
"longitude": 9.15049
}
},
{
"point": {
"latitude": 50.033688,
"longitude": 14.8226
}
},
{
"point": {
"latitude": 50.033688,
"longitude": 14.538226
}
},
{
"point": {
"latitude": 50.033688,
"longitude": 13.538226
}
}
],
"options": {
"travelMode": "truck",
"vehicleMaxSpeed": 110
}
}
axios.post('https://api.tomtom.com/routing/waypointoptimization/1/best?key=apikey', data)
.then(response => {
console.log(response)
})