Javascript example not work

Hi!

I have added the example in javascript in my code and when I run it, it gives me a url that answers an error 404. The url that is created is the following:

https://api.routexl.nl/tour?locations[0][name]=1&locations[0][lat]=52.05429&locations[0][lng]=4.248618&locations[1][name]=2&locations[1][lat]=52.076892&locations[1][lng]=4.26975&locations[2][name]=3&locations[2][lat]=51.669946&locations[2][lng]=5.61852&locations[3][name]=4&locations[3][lat]=51.589548&locations[3][lng]=5.432482&locations[4][name]=5&locations[4][lat]=52.3702&locations[4][lng]=4.8951&locations[4][restrictions][ready]=10&locations[4][restrictions][due]=120

Can you help me please??

Thanks

If you are getting a 404 you are probably not using POST to send the /tour request. Also note that locations should be a JSON encoded array. And, setting restrictions on the last location is not desirable. as the API considers the last location to be the finish point.

Please check the Javascript example at Github for more details.

We have tried the github example, and that is the result it gives us, error 404

We’ve double checked the github example and that works for us:

{“id”:“CO0909Hp”,“count”:5,“feasible”:false,“route”:{“0”:{“name”:“1”,“arrival”:0,“distance”:0},“1”:{“name”:“2”,“arrival”:5,“distance”:3.9},“2”:{“name”:“3”,“arrival”:87,“distance”:137.1},“3”:{“name”:“4”,“arrival”:105,“distance”:160.5},“4”:{“name”:“5”,“arrival”:179,“distance”:265.5}}}

Can you share full code so we can check that?