{"id":2583,"date":"2023-12-22T21:09:41","date_gmt":"2023-12-22T21:09:41","guid":{"rendered":"https:\/\/developers.maplink.global\/consulting-the-restricted-area\/"},"modified":"2024-02-29T17:28:38","modified_gmt":"2024-02-29T17:28:38","slug":"consulting-the-restricted-area","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/consulting-the-restricted-area\/","title":{"rendered":"Consulting the restricted zone"},"content":{"rendered":"\n<p>To query a restriction zone you must make a <strong>GET<\/strong> request to the following endpoint:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\">https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones<\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">GET<\/mark> <br\/><\/strong>This will return all the restriction zones created;<br\/><\/li>\n\n\n\n<li><a href=\"https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/%7B%7BrestrictionZone%7D%7D\">https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/<strong>{{restrictionZone}}<\/strong><\/a> &#8211; <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">GET<\/mark> <br\/><\/strong>Returns only the <strong>specified restriction zone <\/strong>. The term<strong> <\/strong><code>{{restrictionZone}}<\/code> must be replaced by the name of the desired restriction zone.<\/li>\n<\/ul>\n\n<p>To consult the restriction zone created in the <a href=\"https:\/\/developers.maplink.global\/en\/inserting-a-new-restriction-area\/\" data-type=\"post\" data-id=\"1324\">previous example<\/a>, we will make a <strong>GET <\/strong>request to the endpoint: <a href=\"https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/RestrictionZone1\">https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/RestrictionZone1<\/a><\/p>\n\n<p>The response will return all the information regarding the desired restriction zone. The field <code>status<\/code> indicates whether the restriction zone is ready for use or whether there was an error in its creation, such as an incomplete polygon, for example.<\/p>\n\n<p>The possible values can be returned at <code>status<\/code>:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><code>IN_CALCULATION(\"Calculating roads inside geometries\")<\/code> &#8211; This means that the restriction zone is still being processed and is not available for use.<\/li>\n\n\n\n<li><code>CALCULATED(\"Roads inside restriction zone calculated\")<\/code> &#8211; The restriction zone has been successfully created and is now available for use.<\/li>\n\n\n\n<li><code>CALCULATED_WITHOUT_ROADS(\"No road found after calculation inside restriction zone\")<\/code> &#8211; The restriction zone has been successfully created, but there is no road running through it.<\/li>\n\n\n\n<li><code>CALCULATION_ERROR(\"Error trying to calculate restriction zone: [%s]\")<\/code> &#8211; There has been an error in the creation of the restriction zone and it is not available for use. The error message will give more details of what may have happened.<\/li>\n<\/ul>\n\n<p>The full response can be found below:<\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    \"name\": \"RestrictionZone1\",\n    \"geometries\": [\n        {\n            \"name\": \"Polygon1\",\n            \"vertices\": [\n                {\n                    \"latitude\": -23.694834,\n                    \"longitude\": -46.777038\n                },\n                {\n                    \"latitude\": -23.694834,\n                    \"longitude\": -46.448822\n                },\n                {\n                    \"latitude\": -23.472064,\n                    \"longitude\": -46.448822\n                },\n                {\n                    \"latitude\": -23.472064,\n                    \"longitude\": -46.777038\n                }\n            ]\n        }\n    ],\n    \"status\": {\n        \"name\": \"CALCULATED\",\n        \"description\": \"Roads inside restriction zone calculated\"\n    }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To query a restriction zone you must make a GET request to the following endpoint: To consult the restriction zone created in the previous example, we will make a GET request to the endpoint: https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones\/RestrictionZone1 The response will return all the information regarding the desired restriction zone. The field status indicates whether the restriction zone [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[162],"tags":[],"class_list":["post-2583","post","type-post","status-publish","format-standard","hentry","category-restriction-zone-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/comments?post=2583"}],"version-history":[{"count":3,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2583\/revisions"}],"predecessor-version":[{"id":2600,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2583\/revisions\/2600"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}