Code Monkey home page Code Monkey logo

evolutionapi_chatwoot_docker's Introduction

EvolutionApi + Chatwoot on Docker

Repository to help install Evolution API + Chatwoot on Docker.
Used as the docker-compose base of the wppconnect project, and adapted to work with EvolutionApi

This installation includes the following packages:

  • EvolutionAPI: The EvolutionAPI package.
  • Chatwoot: The Chatwoot package.
  • Nginx: The Nginx web server.
  • Postgres: The PostgreSQL database.
  • Redis: The Redis in-memory data structure store.
  • PgAdmin: The PgAdmin web-based administration tool for PostgreSQL.

Installation

First, clone the repository using the following command:

git clone https://github.com/willph/evolutionApi_chatwoot_docker evolution_chatwoot

After that, run the following command:

cd evolution_chatwoot

To copy and paste the file .env.example as .env in these two locations, run the following commands:

cp .env.example .env
cp evolution-api/Docker/.env.example evolution-api/Docker/.env

Inside the "evolution_chatwoot" folder, execute:

docker-compose up --build --no-start

Delete the data folder located inside chatwoot and recreate it. Inside the data folder, create two new folders: redis and postgres.

Wait while it compiles all the data. After completion, enter the following command:

docker-compose run --rm rails bundle exec rails db:chatwoot_prepare

Note: If you get the error in the image below, run the command again.

docker-compose run --rm --trace rails bundle exec rails db:chatwoot_prepare

erro-postgres

The above command will create the entire Chatwoot database. Finally, to finish, execute this command to bring up all the containers:

docker-compose up

Create an Instance in EvolutionApi Send a JSON of type POST to the URL localhost:8080/instance/create

"instanceName": -> the desired name for the instance

"token": -> Create an apiKey for this instance

{
   "instanceName": "Name_Instance",
   "token": "Create_apiKey",
   "qrcode": true
}

create_instance

To set a created instance in EvolutionApi to Chatwoot, you only need to provide the following data:

  • "account_id": the id of the created Chatwoot user
  • "token": token of this created user
  • "url": "http://rails:3000" This remains unchanged as it is the container where Chatwoot is located.

Send the JSON as a POST request to the URL localhost:8080/chatwoot/set/chosen_instance_name

chosen_instance_name -> This refers to the name chosen when creating the instance.

{
"enabled": true,
"account_id": "id_user_chatwoot",
    "token": "Token_of_user_chatwoot",
    "url": "http://rails:3000",
    "sign_msg": true
}

set_chatwoot

Note: remembering that both the create and set endpoint you need to send the apiKey that is in the .env file in the authorization field in postman or select Api Key Auth in Insomnia

apiKey_env

With the return from set chatwoot, you will get the data from 2 variables:

  • "name_inbox"
  • "webhook_url":

These variables will be used to create an inbox in Chatwoot.

With Chatwoot open and properly logged in, click on Settings, then on Inbox, and Add an Inbox. Choose API as the type.

In the Channel Name field, enter what came in "name_inbox", and in the Webhook URL field, enter what came in "webhook_url":.

Proceed with the remaining steps until you finish and create your inbox.

canal-api

To generate the QRCode in the inbox, go to contacts, then new contacts, and add a contact containing the following data as shown in the image below:

criar-contato

After creating the contact, click on it, then on new message, and in the dialog box that appears, choose the created inbox and write the message iniciar, then click on send message.

gera-qr-code

Now, just go to the inbox and scan the generated QRCode.

qr-code-gerado

Postman EvolutionApi v1.3.1

https://www.postman.com/agenciadgcode/workspace/evolution-api/collection/26869335-21d9320d-803f-4adb-80b3-a5bcbda2dfe6

Note: All tests were performed using Windows 10 and Docker Desktop 4.21.1 (114176). Even though the tutorial is not complete and lacks images, those with some knowledge should be able to test it.

If you need any further assistance, don't hesitate to ask.

Good luck!

evolutionapi_chatwoot_docker's People

Contributors

willph avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.