Calling but not responding using API playground

I am using the Directions Service (POST) in the API playground and added this in the avoid_polygon section:
{
“type”: “Polygon”,
“coordinates”: [
[ [-3.688768, 40.419642], [-3.688732‬, 40.419642], [-3.688732‬, 40.419606], [-3.688768, 40.419606],[-3.688768‬, 40.419642] ]
]}

When I click “Call” it keeps Calling but not responding. Any idea?

Your json is not valid.
Please make sure the polygon is a proper geojson e.g. using http://geojson.io

Best regards

Yeah sorry, my fault when copying it here. I corrected it but it doesn´t work.

If it is still wrong, could you provide an example? I copied mine from https://github.com/GIScience/openrouteservice-docs#examples

Thank you!

If you paste this one

{"avoid_polygons":{"type":"MultiPolygon","coordinates":[[[["11.84669","46.51375"],["11.80206","46.48562"],["11.60980","46.27293"],["11.37016","46.15605"],["11.45942","46.08370"],["11.95930","46.44116"],["11.84669","46.51375"]]],[[["11.08932","45.86586"],["11.16554","46.05512"],["11.33274","45.97143"],["11.08932","45.86586"]]],[[["11.30064","46.22165"],["11.36844","46.22141"],["11.27746","46.12536"],["11.30064","46.22165"]]],[[["11.23356","46.18140"],["11.24287","46.18459"],["11.23628","46.18012"],["11.23356","46.18140"]]],[[]],[[["11.42646","46.28207"],["11.44144","46.28468"],["11.47165","46.28916"],["11.44144","46.27995"],["11.42646","46.28207"]]],[[["11.05018","45.82640"],["11.58645","46.01365"],["11.67984","45.94924"],["11.15867","45.74500"],["11.05018","45.82640"]]],[[["11.42814","46.28423"],["11.43033","46.29512"],["11.45277","46.29265"],["11.42814","46.28423"]]],[[["11.46766","46.31943"],["11.74026","46.53997"],["11.61083","46.57113"],["11.34887","46.41135"],["11.46766","46.31943"]]],[[["11.74335","46.54138"],["11.84171","46.55590"],["11.78455","46.47593"],["11.74335","46.54138"]]]]}}

into the avoid_polygons parameter you will recieve a response. But the Polygons themselves are too big. You need to keep them below 200 square kilometers.

Make sure you are using proper " quotes not or

Best regards

I have copied yours and it does the same, it keeps calling but not giving any response.

Here is how the whole JSON for the Directions Service (POST), in the API playground, request is:

{"coordinates":[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]],"options":{"avoid_polygons":{"type":"MultiPolygon","coordinates":[[[["11.84669","46.51375"],["11.80206","46.48562"],["11.60980","46.27293"],["11.37016","46.15605"],["11.45942","46.08370"],["11.95930","46.44116"],["11.84669","46.51375"]]],[[["11.08932","45.86586"],["11.16554","46.05512"],["11.33274","45.97143"],["11.08932","45.86586"]]],[[["11.30064","46.22165"],["11.36844","46.22141"],["11.27746","46.12536"],["11.30064","46.22165"]]],[[["11.23356","46.18140"],["11.24287","46.18459"],["11.23628","46.18012"],["11.23356","46.18140"]]],[[]],[[["11.42646","46.28207"],["11.44144","46.28468"],["11.47165","46.28916"],["11.44144","46.27995"],["11.42646","46.28207"]]],[[["11.05018","45.82640"],["11.58645","46.01365"],["11.67984","45.94924"],["11.15867","45.74500"],["11.05018","45.82640"]]],[[["11.42814","46.28423"],["11.43033","46.29512"],["11.45277","46.29265"],["11.42814","46.28423"]]],[[["11.46766","46.31943"],["11.74026","46.53997"],["11.61083","46.57113"],["11.34887","46.41135"],["11.46766","46.31943"]]],[[["11.74335","46.54138"],["11.84171","46.55590"],["11.78455","46.47593"],["11.74335","46.54138"]]]]}}}}

You can try it so that you see it doesn’t work.

As the avoid polygon is far from the points of the example, I should be getting the same route as without the avoid polygon. But I fon´t get any response.

In the original requets is a strange character :confused:

{"coordinates":[[-3.6889144778251644,40.41963358797828],[-3.688512146472931,40.41963920350306]],"options":{"avoid_polygons":{"type":"Polygon","coordinates":[[[-3.688768,40.419642],[-3.688732,40.419642],[-3.688732,40.419606],[-3.688768,40.419606],[-3.688768,40.419642]]]}}}

try this body

In this body there are 3 opening brackets { and 4 closing }. Of course it doesn’t work.

Like i said, validate your json before using it and keep it below 200 sq km.

There are online tools like the one mentioned above for this.

Man, thank you so much!