feat(n8n): consulta ticket via API do Z-PRO para tentar obter midia (fase diagnostica)
O ChatFlow do Z-PRO nao expoe nenhuma variavel de imagem/anexo no seletor (confirmado pelo usuario) -- so metadados de contato/sessao. Adiciona chamada a showticketchatbot logo apos extrair os campos do webhook, guardando a resposta crua em 'ticketApiRaw' para inspecionar o formato real antes de extrair a URL da midia definitivamente. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,8 +7,8 @@
|
|||||||
"parameters": {
|
"parameters": {
|
||||||
"httpMethod": "POST",
|
"httpMethod": "POST",
|
||||||
"path": "orcamento-exames-zpro",
|
"path": "orcamento-exames-zpro",
|
||||||
"options": {},
|
"responseMode": "responseNode",
|
||||||
"responseMode": "responseNode"
|
"options": {}
|
||||||
},
|
},
|
||||||
"id": "webhook-orcamento",
|
"id": "webhook-orcamento",
|
||||||
"name": "Webhook - Foto Exame",
|
"name": "Webhook - Foto Exame",
|
||||||
@@ -133,8 +133,9 @@
|
|||||||
{
|
{
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"model": {
|
"model": {
|
||||||
|
"__rl": true,
|
||||||
"mode": "id",
|
"mode": "id",
|
||||||
"value": "gpt-4o"
|
"value": "gpt-5.6-luna"
|
||||||
},
|
},
|
||||||
"builtInTools": {},
|
"builtInTools": {},
|
||||||
"options": {}
|
"options": {}
|
||||||
@@ -212,17 +213,106 @@
|
|||||||
"name": "Simple Memory"
|
"name": "Simple Memory"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"parameters": {
|
||||||
|
"respondWith": "text",
|
||||||
|
"responseBody": "={{ $json.output }}",
|
||||||
|
"options": {}
|
||||||
|
},
|
||||||
"id": "responder-webhook",
|
"id": "responder-webhook",
|
||||||
"name": "Responder Webhook (texto)",
|
"name": "Responder Webhook (texto)",
|
||||||
"type": "n8n-nodes-base.respondToWebhook",
|
"type": "n8n-nodes-base.respondToWebhook",
|
||||||
"typeVersion": 1.5,
|
"typeVersion": 1.5,
|
||||||
"position": [
|
"position": [
|
||||||
900,
|
912,
|
||||||
-128
|
-128
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "buscar-ticket-zpro",
|
||||||
|
"name": "Buscar ticket (Z-PRO)",
|
||||||
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
|
"typeVersion": 4.4,
|
||||||
|
"position": [
|
||||||
|
-240,
|
||||||
|
160
|
||||||
],
|
],
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"respondWith": "text",
|
"method": "POST",
|
||||||
"responseBody": "={{ $json.output }}",
|
"url": "https://apigchat.gtigrupo.com.br/v2/api/external/ab2d51db-54e3-48c2-8b97-114a20340809/showticketchatbot",
|
||||||
|
"authentication": "genericCredentialType",
|
||||||
|
"genericAuthType": "httpHeaderAuth",
|
||||||
|
"sendBody": true,
|
||||||
|
"contentType": "json",
|
||||||
|
"specifyBody": "json",
|
||||||
|
"jsonBody": "={{ JSON.stringify({ number: $json.telefone }) }}",
|
||||||
|
"options": {
|
||||||
|
"timeout": 15000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"credentials": {
|
||||||
|
"httpHeaderAuth": {
|
||||||
|
"id": "8XHGuA4cg9z1jUq8",
|
||||||
|
"name": "ZPRO API Token - Canal QR - MC AGENDAMENTO"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"onError": "continueErrorOutput"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mesclar-dados-ticket",
|
||||||
|
"name": "Mesclar dados do ticket",
|
||||||
|
"type": "n8n-nodes-base.set",
|
||||||
|
"typeVersion": 3.4,
|
||||||
|
"position": [
|
||||||
|
-100,
|
||||||
|
160
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"assignments": {
|
||||||
|
"assignments": [
|
||||||
|
{
|
||||||
|
"id": "merge-sessionid",
|
||||||
|
"name": "sessionId",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ $('Extrair campos do webhook').item.json.sessionId }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "merge-telefone",
|
||||||
|
"name": "telefone",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ $('Extrair campos do webhook').item.json.telefone }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "merge-nomecontato",
|
||||||
|
"name": "nomeContato",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ $('Extrair campos do webhook').item.json.nomeContato }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "merge-entrada",
|
||||||
|
"name": "entrada",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ $('Extrair campos do webhook').item.json.entrada }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "merge-imagemurl",
|
||||||
|
"name": "imagemUrl",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ $('Extrair campos do webhook').item.json.imagemUrl }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "merge-tipomidia",
|
||||||
|
"name": "tipoMidia",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ $('Extrair campos do webhook').item.json.tipoMidia }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "merge-ticketapiraw",
|
||||||
|
"name": "ticketApiRaw",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ JSON.stringify($json) }}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"options": {}
|
"options": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,17 +329,6 @@
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Extrair campos do webhook": {
|
|
||||||
"main": [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"node": "É mensagem de imagem?",
|
|
||||||
"type": "main",
|
|
||||||
"index": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"É mensagem de imagem?": {
|
"É mensagem de imagem?": {
|
||||||
"main": [
|
"main": [
|
||||||
[
|
[
|
||||||
@@ -336,6 +415,46 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"Extrair campos do webhook": {
|
||||||
|
"main": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Buscar ticket (Z-PRO)",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Buscar ticket (Z-PRO)": {
|
||||||
|
"main": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Mesclar dados do ticket",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Mesclar dados do ticket",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Mesclar dados do ticket": {
|
||||||
|
"main": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "É mensagem de imagem?",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|||||||
Reference in New Issue
Block a user