{"id":2581,"date":"2023-12-22T21:06:07","date_gmt":"2023-12-22T21:06:07","guid":{"rendered":"https:\/\/developers.maplink.global\/inserting-a-new-restriction-area\/"},"modified":"2024-02-29T17:27:05","modified_gmt":"2024-02-29T17:27:05","slug":"inserting-a-new-restriction-area","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/inserting-a-new-restriction-area\/","title":{"rendered":"Inserting a new restriction zone"},"content":{"rendered":"\n<p>To insert a new restriction zone you will make a <strong>POST<\/strong> request to the following endpoint:<\/p>\n\n<p><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-luminous-vivid-amber-color\">POST<\/mark><\/strong><\/p>\n\n<p>You will need an <strong>array<\/strong> with the latitudes and longitudes of each vertex in the polygon.<\/p>\n\n<p>The following parameters must be entered:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><code>name<\/code>  &#8211; Unique name with the name of the restricted area;<\/li>\n\n\n\n<li><code>geometries<\/code> &#8211; Array containing the polygons with their respective vertices in the restriction zone. You can register one or more geometries in the same restriction zone, as long as the geometry names are unique;\n<ul class=\"wp-block-list\">\n<li><code>name<\/code>  &#8211; Optional geometry name;<\/li>\n\n\n\n<li><code>vertices<\/code>  &#8211; Array of vertices containing latitude and longitude.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<p>An example of a request can be seen 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}<\/pre>\n\n<p>Once the message <code>\"<strong>201 - Restriction zone successfully created<\/strong>\"<\/code> has been received, the restricted zone can be consulted and used with the <a href=\"https:\/\/developers.maplink.global\/en\/building-requests-for-the-trip-api\/\" data-type=\"post\" data-id=\"1074\">Trip<\/a>, <a href=\"https:\/\/developers.maplink.global\/en\/building-requests-for-the-planning-api\/\" data-type=\"post\" data-id=\"1013\">Planning<\/a> or <a href=\"https:\/\/developers.maplink.global\/construindo-requisicoes-para-a-distance-matrix-api\/\" data-type=\"post\" data-id=\"1197\">Distance Matrix<\/a> APIs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To insert a new restriction zone you will make a POST request to the following endpoint: https:\/\/api.maplink.global\/restriction\/v1\/restrictionZones &#8211; POST You will need an array with the latitudes and longitudes of each vertex in the polygon. The following parameters must be entered: An example of a request can be seen below: Once the message &#8220;201 &#8211; [&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-2581","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\/2581","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=2581"}],"version-history":[{"count":3,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2581\/revisions"}],"predecessor-version":[{"id":2598,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2581\/revisions\/2598"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}