curl --request PATCH \
--url https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"type": "Polygon",
"coordinates": [
[
[
-46.6558,
-23.5615
],
[
-46.65,
-23.5615
],
[
-46.65,
-23.557
],
[
-46.6558,
-23.557
],
[
-46.6558,
-23.5615
]
]
]
}
'import requests
url = "https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices"
payload = {
"type": "Polygon",
"coordinates": [[[-46.6558, -23.5615], [-46.65, -23.5615], [-46.65, -23.557], [-46.6558, -23.557], [-46.6558, -23.5615]]]
}
headers = {
"Authorization": "Basic <encoded-value>",
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Basic <encoded-value>',
'api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'Polygon',
coordinates: [
[
[-46.6558, -23.5615],
[-46.65, -23.5615],
[-46.65, -23.557],
[-46.6558, -23.557],
[-46.6558, -23.5615]
]
]
})
};
fetch('https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'Polygon',
'coordinates' => [
[
[
-46.6558,
-23.5615
],
[
-46.65,
-23.5615
],
[
-46.65,
-23.557
],
[
-46.6558,
-23.557
],
[
-46.6558,
-23.5615
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices"
payload := strings.NewReader("{\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n -46.6558,\n -23.5615\n ],\n [\n -46.65,\n -23.5615\n ],\n [\n -46.65,\n -23.557\n ],\n [\n -46.6558,\n -23.557\n ],\n [\n -46.6558,\n -23.5615\n ]\n ]\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices")
.header("Authorization", "Basic <encoded-value>")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n -46.6558,\n -23.5615\n ],\n [\n -46.65,\n -23.5615\n ],\n [\n -46.65,\n -23.557\n ],\n [\n -46.6558,\n -23.557\n ],\n [\n -46.6558,\n -23.5615\n ]\n ]\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n -46.6558,\n -23.5615\n ],\n [\n -46.65,\n -23.5615\n ],\n [\n -46.65,\n -23.557\n ],\n [\n -46.6558,\n -23.557\n ],\n [\n -46.6558,\n -23.5615\n ]\n ]\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 27,
"type": "Polygon",
"coordinates": [
[
[
-46.6558,
-23.5615
],
[
-46.65,
-23.5615
],
[
-46.65,
-23.557
],
[
-46.6558,
-23.557
],
[
-46.6558,
-23.5615
]
]
]
}
}Atualizar vértices da área da dinâmica
Substitui todos os vértices do polígono de uma área de dinâmica, a partir de um objeto GeoJSON do tipo Polygon (RFC 7946). Como a área é imutável após criada, a alteração de geometria cria internamente uma NOVA área (copiando os demais atributos da área original) — a resposta traz um id de área diferente do informado na URL, que deve ser usado nas próximas requisições.
curl --request PATCH \
--url https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"type": "Polygon",
"coordinates": [
[
[
-46.6558,
-23.5615
],
[
-46.65,
-23.5615
],
[
-46.65,
-23.557
],
[
-46.6558,
-23.557
],
[
-46.6558,
-23.5615
]
]
]
}
'import requests
url = "https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices"
payload = {
"type": "Polygon",
"coordinates": [[[-46.6558, -23.5615], [-46.65, -23.5615], [-46.65, -23.557], [-46.6558, -23.557], [-46.6558, -23.5615]]]
}
headers = {
"Authorization": "Basic <encoded-value>",
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Basic <encoded-value>',
'api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'Polygon',
coordinates: [
[
[-46.6558, -23.5615],
[-46.65, -23.5615],
[-46.65, -23.557],
[-46.6558, -23.557],
[-46.6558, -23.5615]
]
]
})
};
fetch('https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'Polygon',
'coordinates' => [
[
[
-46.6558,
-23.5615
],
[
-46.65,
-23.5615
],
[
-46.65,
-23.557
],
[
-46.6558,
-23.557
],
[
-46.6558,
-23.5615
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices"
payload := strings.NewReader("{\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n -46.6558,\n -23.5615\n ],\n [\n -46.65,\n -23.5615\n ],\n [\n -46.65,\n -23.557\n ],\n [\n -46.6558,\n -23.557\n ],\n [\n -46.6558,\n -23.5615\n ]\n ]\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices")
.header("Authorization", "Basic <encoded-value>")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n -46.6558,\n -23.5615\n ],\n [\n -46.65,\n -23.5615\n ],\n [\n -46.65,\n -23.557\n ],\n [\n -46.6558,\n -23.557\n ],\n [\n -46.6558,\n -23.5615\n ]\n ]\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-vendas.taximachine.com.br/api/v2/integracao/dinamicas/area/{id}/vertices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n -46.6558,\n -23.5615\n ],\n [\n -46.65,\n -23.5615\n ],\n [\n -46.65,\n -23.557\n ],\n [\n -46.6558,\n -23.557\n ],\n [\n -46.6558,\n -23.5615\n ]\n ]\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 27,
"type": "Polygon",
"coordinates": [
[
[
-46.6558,
-23.5615
],
[
-46.65,
-23.5615
],
[
-46.65,
-23.557
],
[
-46.6558,
-23.557
],
[
-46.6558,
-23.5615
]
]
]
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Obrigatório. Sua chave API.
Path Parameters
Identificador da área cujos vértices serão atualizados.
Body
Tipo de geometria GeoJSON. Deve ser Polygon.
Polygon Array com exatamente um anel de coordenadas (coordinates[0]), com ao menos 4 posições (mínimo de 3 vértices distintos mais o fechamento do anel, ou seja, a primeira posição igual à última). Cada posição é um par [lng, lat], com lng entre -180 e 180 e lat entre -90 e 90.
1 element42 elementsResponse
Vértices atualizados com sucesso
The response is of type object.
