Decodificar mensagens WhatsApp
curl --request POST \
--url https://api.metrito.com/v3/tracking/messages/decode \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"text": "Olá, tenho interesse no produto!"
},
{
"text": "Qual o preço?"
}
]
}
'import requests
url = "https://api.metrito.com/v3/tracking/messages/decode"
payload = { "messages": [{ "text": "Olá, tenho interesse no produto!" }, { "text": "Qual o preço?" }] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{text: 'Olá, tenho interesse no produto!'}, {text: 'Qual o preço?'}]
})
};
fetch('https://api.metrito.com/v3/tracking/messages/decode', 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/messages/decode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'text' => 'Olá, tenho interesse no produto!'
],
[
'text' => 'Qual o preço?'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.metrito.com/v3/tracking/messages/decode"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"text\": \"Olá, tenho interesse no produto!\"\n },\n {\n \"text\": \"Qual o preço?\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.metrito.com/v3/tracking/messages/decode")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"text\": \"Olá, tenho interesse no produto!\"\n },\n {\n \"text\": \"Qual o preço?\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metrito.com/v3/tracking/messages/decode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"text\": \"Olá, tenho interesse no produto!\"\n },\n {\n \"text\": \"Qual o preço?\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"messages": [
{
"text": "Olá, tenho interesse no produto!",
"decoded_text": "Olá, tenho interesse no produto!",
"decoded_id": 1234567890,
"params": {
"utm_source": "instagram",
"utm_medium": "cpc",
"utm_campaign": "120215678901234567"
},
"tracking_link_id": "64a1b2c3d4e5f6a7b8c9d0e4",
"selected_target": null
},
{
"text": "Qual o preço?",
"decoded_text": "Qual o preço?",
"decoded_id": null,
"params": null,
"tracking_link_id": null,
"selected_target": null
}
]
}{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "trigger.type must be 'api' for Partner API triggers",
"request_id": "req_abc123"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked.",
"request_id": "req_abc123"
}
}Mensagens
Decodificar Mensagens
Decodifica mensagens rastreadas do WhatsApp, retornando os parâmetros UTM e dados de rastreamento originais associados a cada mensagem.
POST
/
v3
/
tracking
/
messages
/
decode
Decodificar mensagens WhatsApp
curl --request POST \
--url https://api.metrito.com/v3/tracking/messages/decode \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"text": "Olá, tenho interesse no produto!"
},
{
"text": "Qual o preço?"
}
]
}
'import requests
url = "https://api.metrito.com/v3/tracking/messages/decode"
payload = { "messages": [{ "text": "Olá, tenho interesse no produto!" }, { "text": "Qual o preço?" }] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{text: 'Olá, tenho interesse no produto!'}, {text: 'Qual o preço?'}]
})
};
fetch('https://api.metrito.com/v3/tracking/messages/decode', 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/messages/decode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'text' => 'Olá, tenho interesse no produto!'
],
[
'text' => 'Qual o preço?'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.metrito.com/v3/tracking/messages/decode"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"text\": \"Olá, tenho interesse no produto!\"\n },\n {\n \"text\": \"Qual o preço?\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.metrito.com/v3/tracking/messages/decode")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"text\": \"Olá, tenho interesse no produto!\"\n },\n {\n \"text\": \"Qual o preço?\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metrito.com/v3/tracking/messages/decode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"text\": \"Olá, tenho interesse no produto!\"\n },\n {\n \"text\": \"Qual o preço?\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"messages": [
{
"text": "Olá, tenho interesse no produto!",
"decoded_text": "Olá, tenho interesse no produto!",
"decoded_id": 1234567890,
"params": {
"utm_source": "instagram",
"utm_medium": "cpc",
"utm_campaign": "120215678901234567"
},
"tracking_link_id": "64a1b2c3d4e5f6a7b8c9d0e4",
"selected_target": null
},
{
"text": "Qual o preço?",
"decoded_text": "Qual o preço?",
"decoded_id": null,
"params": null,
"tracking_link_id": null,
"selected_target": null
}
]
}{
"error": {
"type": "validation_error",
"code": "invalid_parameter",
"message": "trigger.type must be 'api' for Partner API triggers",
"request_id": "req_abc123"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked.",
"request_id": "req_abc123"
}
}Authorizations
bearerAuthapiKeyAuth
JWT da plataforma ou API key mtk_live_...
Body
application/json
Lista de mensagens a decodificar
Maximum array length:
100Show child attributes
Show child attributes
Response
Mensagens decodificadas com sucesso
Show child attributes
Show child attributes
⌘I