Para o sucesso desse tutorial presume-se que o Chatwoot encontra-se instalado e configurado. Documentação Oficial: http://doc.evolution-api.com/ Git para download: https://github.com/EvolutionAPI/evolution-api
cd git clone https://github.com/EvolutionAPI/evolution-api.git
mv docker-compose.yaml.example docker-compose.yaml
cd Docker mv .env.exemple .env vim .env
# Server URL - Set your application url SERVER_URL=http://192.168.0.254:8081 # Name that will be displayed on smartphone connection CONFIG_SESSION_PHONE_CLIENT=CuidadoDigital ## Define a global apikey to access all instances. ### OBS: This key must be inserted in the request header to create an instance. AUTHENTICATION_API_KEY=Lqxb8hZvimZi2L0OXOxeoy7OmF91tChJjnoC6h5tKejIqQEYikZEmN5gYg3LKiHT
cd ~/evolution-api docker-compose up -d
# Comando
curl 127.0.0.1:8081
# Resposta esperada
{"status":200,"message":"Welcome to the Evolution API, it is working!","version":"1.5.1"}
curl -X POST http://127.0.0.1:8081/instance/create \
-H "apikey: B6D711FCDE4D4120E713976" \
-H "Content-Type: application/json" \
-d '{
"instanceName": "Whatsapp",
"token": "",
"qrcode": true,
"chatwoot_account_id": 1,
"chatwoot_token": "cndZK3pd6safasdfas1seb27oUNzf8FPx",
"chatwoot_url": "https://app.minhaempresa.com.br/",
"chatwoot_sign_msg": true,
"chatwoot_reopen_conversation": true,
"chatwoot_conversation_pending": false
}'
curl -X POST http://127.0.0.1:8081/settings/set/Whatsapp \
-H "apikey: B6D711FCDE4D4FD5936544120E713976" \
-H "Content-Type: application/json" \
-d '{
"reject_call": false,
"msg_call": "",
"groups_ignore": true,
"always_online": true,
"read_messages": false,
"read_status": false
}'
curl -X DELETE http://127.0.0.1:8081/instance/logout/Whatsapp \ -H "apikey: B6D711FCDE4D4FD5936544120E713976" \ -H "Content-Type: application/json"
curl -X DELETE http://127.0.0.1:8081/instance/delete/Whatsapp \ -H "apikey: B6D711FCDE4D4FD5936544120E713976" \ -H "Content-Type: application/json"
curl -X GET http://127.0.0.1:8081/instance/fetchInstances \ -H "apikey: B6D711FCDE4D4FD5936544120E713976" \ -H "Content-Type: application/json"
curl -X GET http://127.0.0.1:8081/instance/restart/Whatsapp \ -H "apikey: B6D711FCDE4D4FD5936544120E713976" \ -H "Content-Type: application/json"