Deletar gatilho
curl --request DELETE \
--url https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}', 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.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked.",
"request_id": "req_abc123"
}
}{
"error": {
"type": "not_found_error",
"code": "resource_not_found",
"message": "Trigger not found",
"request_id": "req_abc123"
}
}Gatilhos
Deletar Gatilho
Remove um gatilho. Apenas gatilhos com trigger.type = "api" podem ser deletados via API pública.
DELETE
/
v3
/
tracking
/
containers
/
{container_id}
/
triggers
/
{trigger_id}
Deletar gatilho
curl --request DELETE \
--url https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}', 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.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metrito.com/v3/tracking/containers/{container_id}/triggers/{trigger_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked.",
"request_id": "req_abc123"
}
}{
"error": {
"type": "not_found_error",
"code": "resource_not_found",
"message": "Trigger not found",
"request_id": "req_abc123"
}
}Authorizations
bearerAuthapiKeyAuth
JWT da plataforma ou API key mtk_live_...
Path Parameters
Identificador do container. Aceita três formatos:
- ObjectId —
64a1b2c3d4e5f6a7b8c9d0e1(encontrado na URL da plataforma após/containers/) - Domínio —
minhaloja.com.br(containers v2, o domínio real) - Metrito Tracking Code —
MTC-AB12(containers v3, visível na sidebar da plataforma)
Examples:
"64a1b2c3d4e5f6a7b8c9d0e1"
"minhaloja.com.br"
"MTC-AB12"
ID do gatilho
Example:
"64a1b2c3d4e5f6a7b8c9d0e2"
Response
Gatilho deletado com sucesso
⌘I