mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-13 07:04:50 -06:00
fix: Update view manager
This commit is contained in:
parent
074a861fb4
commit
ed5e66e430
@ -17,6 +17,7 @@
|
||||
### Integrations
|
||||
|
||||
- Chatwoot: v2.18.0 - v3.0.0
|
||||
- Manager Evolution API
|
||||
|
||||
# 1.4.8 (2023-07-27 10:27)
|
||||
|
||||
|
@ -29,13 +29,13 @@
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "322486a5-e6a7-4af9-8a3f-0ebc444912f0",
|
||||
"id": "7a89a538-2cae-4032-8896-09627c07bc68",
|
||||
"name": "Info Base",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
1820,
|
||||
880
|
||||
620,
|
||||
480
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -56,13 +56,13 @@
|
||||
"jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"Bot {{ $('Info Base').item.json[\"organization\"] }}\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"{{ $('Info Base').item.json[\"logo\"] }}\"\n}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "61742c2d-d195-4a68-a2eb-a36839b6376a",
|
||||
"id": "12a39df3-6b95-4f83-a0bc-50b25adaca7f",
|
||||
"name": "Cria Contato Bot",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2220,
|
||||
880
|
||||
1020,
|
||||
480
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -83,24 +83,24 @@
|
||||
"jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "866ddf42-2d5f-4bf2-8552-2379a5cdc2a5",
|
||||
"id": "bed7c54d-e232-4fe4-9584-0515e9679868",
|
||||
"name": "Cria Inbox Start",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2020,
|
||||
880
|
||||
820,
|
||||
480
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "f1c2478a-9a1d-4cd4-82de-2002281c020b",
|
||||
"id": "36ada769-a757-4193-989b-0cc4ea504b80",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1620,
|
||||
880
|
||||
420,
|
||||
480
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -118,16 +118,16 @@
|
||||
},
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"jsonBody": "={\n \"name\": \"Create Company Chatwoot\",\n \"description\": \"Create Company Chatwoot\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"https://webhooks.n8n.evolution-api.com/webhook/criadorchatwoot\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"Tema Criador de Empresa:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
|
||||
"jsonBody": "={\n \"name\": \"Create Company Chatwoot\",\n \"description\": \"Create Company Chatwoot\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/criadorchatwoot\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"Tema Criador de Empresa:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "e776b87b-57a6-4782-9ad9-cd0000aab29c",
|
||||
"id": "f5bbb285-71a8-4c58-a4d7-e56002d697f0",
|
||||
"name": "Cria Automação Empresas",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2420,
|
||||
880
|
||||
1220,
|
||||
480
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -145,16 +145,16 @@
|
||||
},
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox EvolutionAPI\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Info Base').item.json[\"api_access_token\"] }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n \n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n\n\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
|
||||
"jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Info Base').item.json[\"api_access_token\"] }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n \n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n\n\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "d89ed76c-a5e9-42e6-b55b-e779e9a33a53",
|
||||
"id": "a36bebdc-a318-40a2-8532-c7f476f8adb7",
|
||||
"name": "Cria Automação Inboxes",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2620,
|
||||
880
|
||||
1420,
|
||||
480
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -162,13 +162,13 @@
|
||||
"content": "## Workflow Para Configurar admin\n**Aqui você prepara o Chatwoot Principal com um usuário (Superadmin) que poderá criar empresas e caixas de entrada**\n**Instruções**\n**No node Info Base, configure as variáveis de seu Chatwoot e N8N**\n**Obs: A variável api_access_token é o token do usuário que irá poder criar as empresas**",
|
||||
"width": 894.6435495898575
|
||||
},
|
||||
"id": "a4597492-843a-44c7-836a-f30c91d46a20",
|
||||
"id": "db66e867-e9f4-452d-b521-725eeac652c8",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1620,
|
||||
680
|
||||
420,
|
||||
280
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -232,8 +232,8 @@
|
||||
},
|
||||
"active": false,
|
||||
"settings": {},
|
||||
"versionId": "5275c59f-9230-4149-9107-e87c86759427",
|
||||
"id": "HmHVbJIXCOd57rBU",
|
||||
"versionId": "78f155dc-7809-4bfc-9282-63f49b07fc4d",
|
||||
"id": "BSATyGpGWLR4ZwNm",
|
||||
"meta": {
|
||||
"instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"
|
||||
},
|
@ -7,13 +7,13 @@
|
||||
"path": "criadorchatwoot",
|
||||
"options": {}
|
||||
},
|
||||
"id": "1bbcdc39-46af-4476-a381-981a96be3726",
|
||||
"id": "5a47c10a-e43c-4fa5-baad-4b6cc511bfcd",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1360,
|
||||
840
|
||||
1420,
|
||||
860
|
||||
],
|
||||
"webhookId": "6fe428e3-1752-453c-9358-abf18b793387"
|
||||
},
|
||||
@ -45,13 +45,13 @@
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "ec9927e2-d075-4f3f-8655-d1269d25bac2",
|
||||
"id": "8295c119-3a96-424e-9386-43d75f6816f5",
|
||||
"name": "Cria Conta",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
1960,
|
||||
840
|
||||
2020,
|
||||
860
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -86,13 +86,13 @@
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "1ce013fd-0445-488c-b73f-b86597a5b556",
|
||||
"id": "4fe5007a-3a6b-490a-a446-e45cc168189f",
|
||||
"name": "Cria Usuario",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2160,
|
||||
840
|
||||
2220,
|
||||
860
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -123,13 +123,13 @@
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "a9156473-1916-446b-9e50-e906794c7c5b",
|
||||
"id": "848c55e2-5678-4291-9602-c94d994da95b",
|
||||
"name": "Add Usuario a Conta",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2360,
|
||||
840
|
||||
2420,
|
||||
860
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -140,13 +140,13 @@
|
||||
"text": "=Olá seja bem vindo:\n\nAbaixo segue seus dados de acesso:\n\nURL: {{ $('Info Base').item.json[\"chatwoot_url\"] }}\n\nuser: {{ $('LimpaDados').item.json[\"email\"] }}\n\nSenha: {{ $('LimpaDados').item.json[\"password\"] }}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "2d0b3e35-6e51-4e9b-90b4-6382dc6fec88",
|
||||
"id": "27f3b24f-1cf2-4d0d-a354-ecba066059f6",
|
||||
"name": "Send Email",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
3160,
|
||||
840
|
||||
3220,
|
||||
860
|
||||
],
|
||||
"credentials": {
|
||||
"smtp": {
|
||||
@ -203,13 +203,13 @@
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "1efc0806-2fe7-4670-9a0c-ab71592d0bbb",
|
||||
"id": "38b4069d-e51e-4db7-933f-941b1be6d124",
|
||||
"name": "Info Base",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
1760,
|
||||
840
|
||||
1820,
|
||||
860
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -237,13 +237,13 @@
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "602accf3-f01a-46ac-a22f-37c964c0ec76",
|
||||
"id": "28e29e73-aadc-49ca-bd6d-b57ee0160a21",
|
||||
"name": "LimpaDados",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
1560,
|
||||
840
|
||||
1620,
|
||||
860
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -264,13 +264,13 @@
|
||||
"jsonBody": "={\n \"inbox_id\": {{ $('Cria Inbox Start').item.json[\"id\"] }},\n \"name\": \"Bot {{ $('Info Base').item.json[\"organization\"] }}\",\n \"phone_number\": \"+123456\",\n \"avatar_url\": \"{{ $('Info Base').item.json[\"logo\"] }}\"\n}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "974e672e-fa4a-44ab-b6df-7aacd2bdb329",
|
||||
"id": "bb671443-bdb4-4f56-99af-f0baef246a3e",
|
||||
"name": "Cria Contato Bot",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2760,
|
||||
840
|
||||
2820,
|
||||
860
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -288,16 +288,16 @@
|
||||
},
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox EvolutionAPI\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Cria Usuario').item.json.access_token }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
|
||||
"jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Cria Usuario').item.json.access_token }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "fb5597d4-0af1-461b-912b-7671a88c8368",
|
||||
"id": "e016a2af-b212-4e00-a3ff-8cd03530aa06",
|
||||
"name": "Cria Automação",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2960,
|
||||
840
|
||||
3020,
|
||||
860
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -318,13 +318,13 @@
|
||||
"jsonBody": "={\n \"name\": \"Start {{ $('Info Base').item.json[\"organization\"] }}\",\n \"channel\": {\n \"type\": \"api\",\n \"website_url\": \"\"\n }\n}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "a09bc90a-d643-422c-90ae-f8baa41ee532",
|
||||
"id": "d3c42148-8920-4c98-a874-eb7113f2dd22",
|
||||
"name": "Cria Inbox Start",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2560,
|
||||
840
|
||||
2620,
|
||||
860
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -333,13 +333,13 @@
|
||||
"height": 304.02684563758396,
|
||||
"width": 1129.7777777777778
|
||||
},
|
||||
"id": "f742f53d-58bc-4e26-bb82-1db352425eff",
|
||||
"id": "d07516c0-4c8e-43ab-ba86-c8d063b09be5",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1360,
|
||||
500
|
||||
1420,
|
||||
520
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -447,8 +447,8 @@
|
||||
},
|
||||
"active": true,
|
||||
"settings": {},
|
||||
"versionId": "98d3de5d-b1b2-4e13-b6e6-07fa827f54fd",
|
||||
"id": "mVLlfZvGjtR8SZLT",
|
||||
"versionId": "3ffd6d3f-6966-4de4-af8f-1fda464bc1b8",
|
||||
"id": "79R6qQDtfyCwgYjJ",
|
||||
"meta": {
|
||||
"instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"
|
||||
},
|
@ -106,30 +106,6 @@
|
||||
300
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"method": "DELETE",
|
||||
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwoot_account_id\"] }}/inboxes/{{ $json.payload[0].id }}",
|
||||
"sendHeaders": true,
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "api_access_token",
|
||||
"value": "={{ $('Info Base').item.json.chatwoot_token }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "e2e2cfe4-0afc-47f2-9176-5e14cb4c66c3",
|
||||
"name": "Deleta Inbox Start",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
1620,
|
||||
300
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwoot_account_id\"] }}/inboxes/",
|
||||
@ -174,11 +150,11 @@
|
||||
"string": [
|
||||
{
|
||||
"name": "chatwoot_url",
|
||||
"value": "https://CHATWOOT_URL"
|
||||
"value": "CHATWOOT_URL"
|
||||
},
|
||||
{
|
||||
"name": "evolution_url",
|
||||
"value": "https://EVOLUTION_URL"
|
||||
"value": "EVOLUTION_URL"
|
||||
},
|
||||
{
|
||||
"name": "global_api_key",
|
||||
@ -256,14 +232,35 @@
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "limit"
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{ $json.name }}",
|
||||
"value2": "=Start {{ $('Info Base').item.json[\"organization\"] }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": "9ed7331d-f2fd-4ee0-8730-2ae7f444aa1e",
|
||||
"name": "Recupera Primeira Inbox",
|
||||
"type": "n8n-nodes-base.itemLists",
|
||||
"typeVersion": 2.2,
|
||||
"id": "a8d955e6-ac51-4316-aeec-09d4d65e943a",
|
||||
"name": "é Start Inbox?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1200,
|
||||
1660,
|
||||
200
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"batchSize": 1,
|
||||
"options": {}
|
||||
},
|
||||
"id": "0d2d2194-aa4a-4241-9022-217d88bb581f",
|
||||
"name": "Split In Batches",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
1420,
|
||||
300
|
||||
]
|
||||
},
|
||||
@ -272,18 +269,98 @@
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{ $json.payload[0].name }}",
|
||||
"value2": "=Start {{ $('Info Base').item.json[\"organization\"] }}"
|
||||
"value1": "={{ $json.name }}",
|
||||
"value2": "={{ $('Webhook').item.json[\"body\"][\"messages\"][0][\"content\"].split(':')[1] }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": "40f705df-b9ff-4645-94ec-e7a5a0ca4777",
|
||||
"name": "é Start Inbox?",
|
||||
"id": "0bfbc2cb-eff5-423c-bd3a-b266aaf6a943",
|
||||
"name": "é_pre-existente?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1400,
|
||||
1900,
|
||||
340
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"method": "PATCH",
|
||||
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwoot_account_id\"] }}/inboxes/{{ $json.id }}",
|
||||
"sendHeaders": true,
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "api_access_token",
|
||||
"value": "={{ $('Info Base').item.json.chatwoot_token }}"
|
||||
},
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"jsonBody": "={\n\"channel\": {\n\"webhook_url\": \"{{ $('Info Base').item.json[\"evolution_url\"] }}/chatwoot/webhook/{{ encodeURIComponent($('Info Base').item.json[\"instance_name\"]) }}\"\n}\n}",
|
||||
"options": {}
|
||||
},
|
||||
"id": "fb589456-5566-4a45-96a7-75986d0aa1d5",
|
||||
"name": "Update_webhook_url",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
2120,
|
||||
340
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"method": "DELETE",
|
||||
"url": "={{ $('Info Base').item.json[\"chatwoot_url\"] }}/api/v1/accounts/{{ $('Info Base').item.json[\"chatwoot_account_id\"] }}/inboxes/{{ $json.id }}",
|
||||
"sendHeaders": true,
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "api_access_token",
|
||||
"value": "={{ $('Info Base').item.json.chatwoot_token }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "e6094941-410f-496c-9c9c-7b95fd9349af",
|
||||
"name": "Deleta Inbox Start",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 3,
|
||||
"position": [
|
||||
1900,
|
||||
100
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {},
|
||||
"id": "8cf9a78f-9e8a-4288-9d7b-801790af68d5",
|
||||
"name": "No Operation, do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1660,
|
||||
400
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"fieldToSplitOut": "payload",
|
||||
"options": {}
|
||||
},
|
||||
"id": "9468896a-5f86-4598-9d20-e8f495cae859",
|
||||
"name": "Ajusta lista",
|
||||
"type": "n8n-nodes-base.itemLists",
|
||||
"typeVersion": 2.2,
|
||||
"position": [
|
||||
1200,
|
||||
300
|
||||
]
|
||||
}
|
||||
@ -305,7 +382,7 @@
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Recupera Primeira Inbox",
|
||||
"node": "Ajusta lista",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
@ -334,7 +411,25 @@
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recupera Primeira Inbox": {
|
||||
"é Start Inbox?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Deleta Inbox Start",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "é_pre-existente?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split In Batches": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
@ -342,14 +437,61 @@
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "No Operation, do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"é Start Inbox?": {
|
||||
"é_pre-existente?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Deleta Inbox Start",
|
||||
"node": "Update_webhook_url",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Split In Batches",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Update_webhook_url": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split In Batches",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Deleta Inbox Start": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split In Batches",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Ajusta lista": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split In Batches",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
@ -359,7 +501,7 @@
|
||||
},
|
||||
"active": true,
|
||||
"settings": {},
|
||||
"versionId": "6fcdaf0a-5bf9-4c3a-b518-364246bd92c2",
|
||||
"versionId": "ab910349-b559-4738-9ac6-de6b06d6bbce",
|
||||
"id": "ByW2ccjR4XPrOyio",
|
||||
"meta": {
|
||||
"instanceId": "4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"
|
@ -244,10 +244,10 @@ export class ChatwootService {
|
||||
|
||||
this.logger.verbose('create message for init instance in chatwoot');
|
||||
|
||||
let contentMsg = '/init';
|
||||
let contentMsg = 'init';
|
||||
|
||||
if (number) {
|
||||
contentMsg = `/init:${number}`;
|
||||
contentMsg = `init:${number}`;
|
||||
}
|
||||
|
||||
const message = await client.messages.create({
|
||||
@ -1459,7 +1459,7 @@ export class ChatwootService {
|
||||
this.logger.verbose('event qrcode.updated');
|
||||
if (body.statusCode === 500) {
|
||||
this.logger.verbose('qrcode error');
|
||||
const erroQRcode = `🚨 QRCode generation limit reached, to generate a new QRCode, send the /init message again.`;
|
||||
const erroQRcode = `🚨 QRCode generation limit reached, to generate a new QRCode, send the 'init' message again.`;
|
||||
|
||||
this.logger.verbose('send message to chatwoot');
|
||||
return await this.createBotMessage(instance, erroQRcode, 'incoming');
|
||||
|
@ -5,7 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="shortcut icon" href="/images/atendai-logo.png" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="https://evolution-api.com/files/evolution-api-favicon.png" type="image/x-icon">
|
||||
<title>Instance Manager</title>
|
||||
</head>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user