After optimisation, POST Tour does not order the locations

hi Guys,

I just discover your API and I need an API like POST tour to manage pickups and deliveries.
However, whatever I try I get always the original order of the locations (A, B, C, D)

Basically, this is the only API I need. If I see this working, I am happy to start soon a subscription because sometimes we need to optimize more than 10 locations.

Please see my example below. I tried “before”:1 or “before”:“1”

[
{
“address”:“A, The Netherlands”,
“lat”:“52.05429”,
“lng”:“4.248618”
},
{
“address”:“B, The Netherlands”,
“lat”:“52.076892”,
“lng”:“4.26975”,
“servicetime”:“60”
},
{
“address”:“C, The Netherlands”,
“lat”:“51.669946”,
“lng”:“5.61852”
},
{
“address”:“D, The Netherlands”,
“lat”:“51.589548”,
“lng”:“5.432482”,
“restrictions”:[
{
“before”:1
}
]
}
]

Sorry, probably this is a better example as I have used the last location in my first one.
I have also tried “after”:2 on the second location. Still the same order (A, B, C, D)

[
{
“address”:“A, The Netherlands”,
“lat”:“52.05429”,
“lng”:“4.248618”
},
{
“address”:“B, The Netherlands”,
“lat”:“52.076892”,
“lng”:“4.26975”,
“servicetime”:“60”
},
{
“address”:“C, The Netherlands”,
“lat”:“51.669946”,
“lng”:“5.61852”,
“restrictions”:[
{
“before”:1
}
]
},
{
“address”:“D, The Netherlands”,
“lat”:“51.589548”,
“lng”:“5.432482”
}
]

Try without the square brackets [ ] in the restrictions, it seems they don’t parse correctly.

Hi,

Without brackets It did work! Thank you very much for the quick response!
2 comments:

  1. Is this a temporary solution? how do I combine additional parameters? just ,{“due”:60}
  2. In combination with skipOptimisation (true or false) is still not working. Only if skipOptimisation is not used at all.

working sample:

[
{
“address”:“A, The Netherlands”,
“lat”:“52.05429”,
“lng”:“4.248618”
},
{
“address”:“B, The Netherlands”,
“lat”:“52.076892”,
“lng”:“4.26975”
},
{
“address”:“C, The Netherlands”,
“lat”:“51.669946”,
“lng”:“5.61852”,
“restrictions”:{
“before”:1
}
},
{
“address”:“D, The Netherlands”,
“lat”:“51.589548”,
“lng”:“5.432482”
}
]

hi there again,

just realised that skipOptimisation is working by passing 0 or 1 instead false or true

Thank you Angelo

Indeed, to combine additional parameters just add them to the restrictions array.