diff --git a/README.md b/README.md index cdbe5dd5..fda3acb0 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,15 @@

Evolution Api

- - +
- + [![License](https://img.shields.io/badge/license-GPL--3.0-orange)](./LICENSE) -[![Support](https://img.shields.io/badge/Buy%20me-coffe-orange)](https://app.picpay.com/user/davidsongomes1998) --> +[![Support](https://img.shields.io/badge/Buy%20me-coffe-orange)](https://app.picpay.com/user/davidsongomes1998) - +
- +
## WhatsApp-Api-NodeJs @@ -44,7 +41,7 @@ sudo usermod -aG docker ${USER} ### Nodejs installation ```sh -nvm install 16.17.0 +nvm install 16.18.1 ``` ### pm2 installation @@ -72,7 +69,7 @@ Using the database is optional. Cloning the Repository ``` -git clone https://github.com/code-chat-br/whatsapp-api.git +git clone https://github.com/EvolutionAPI/evolution-api.git ``` Go to the project directory and install all dependencies.
@@ -91,7 +88,7 @@ npm run start npm run start:prod # pm2 -pm2 start 'npm run start:prod' --name ApiCodechat +pm2 start 'npm run start:prod' --name ApiEvolution ``` ## Authentication @@ -121,7 +118,7 @@ Content-Type: application/json apikey: t8OOEeISKzpmc3jjcMqBWYSaJH2PIxns { - "instanceName": "codechat" + "instanceName": "evolution" } ``` ##### cURL @@ -131,7 +128,7 @@ curl --location --request POST 'http://localhost:8080/instance/create' \ --header 'Content-Type: application/json' \ --header 'apikey: t8OOEeISKzpmc3jjcMqBWYSaJH2PIxns' \ --data-raw '{ - "instanceName": "codechat" + "instanceName": "evolution" }' ``` ### Response @@ -139,7 +136,7 @@ curl --location --request POST 'http://localhost:8080/instance/create' \ ```ts { "instance": { - "instanceName": "codechat", + "instanceName": "evolution", "status": "created" }, "hash": { @@ -155,23 +152,23 @@ curl --location --request POST 'http://localhost:8080/instance/create' \ ##### HTTP ```http -GET /instance/connect/codechat HTTP/1.1 +GET /instance/connect/evolution HTTP/1.1 Host: localhost:8080 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. [...] ``` ```http -GET /instance/connect/codechat HTTP/1.1 +GET /instance/connect/evolution HTTP/1.1 Host: localhost:8080 apikey: 88513847-1B0E-4188-8D76-4A2750C9B6C3 ``` ##### cURL ```bash -curl --location --request GET 'http://localhost:8080/instance/connect/codechat' \ +curl --location --request GET 'http://localhost:8080/instance/connect/evolution' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. [...]' ``` ```bash -curl --location --request GET 'http://localhost:8080/instance/connect/codechat' \ +curl --location --request GET 'http://localhost:8080/instance/connect/evolution' \ --header 'apikey: 88513847-1B0E-4188-8D76-4A2750C9B6C3' ``` @@ -188,7 +185,7 @@ curl --location --request GET 'http://localhost:8080/instance/connect/codechat' - [docker run](./docker.sh) - [docker-compose](./docker-compose.yml) - [env for docker](./Docker/.env) - - [DockerHub-codechat/api](https://hub.docker.com/r/codechat/api) + - [DockerHub Evolution API](https://hub.docker.com/repository/docker/davidsongomes/evolution-api) After building the application, in the same directory as the files above, run the following command: ```sh @@ -198,17 +195,17 @@ docker-compose up | | | |-----|---| | Send Text | ✔ | -| Send Buttons | ✔ | | Send Template | ❌ | | Send Media: audio - video - image - document - gif

base64: ```true``` | ✔ | | Send Media File | ❌ | | Send Audio type WhatsApp | ✔ | | Send Location | ✔ | -| Send List | ✔ | | Send Link Preview | ✔ | | Send Contact | ✔ | | Send Reaction - emoji | ✔ | | Send Poll Message | ✔ | +| Send Buttons (Deprecated) | ❌ | +| Send List (Deprecated) | ❌ | ## Postman collections - [Postman Json](./postman.json) @@ -236,6 +233,29 @@ docker-compose up | GROUP_PARTICIPANTS_UPDATE | group-participants.update | JSON | Notifies when an action occurs involving a participant
'add' | 'remove' | 'promote' | 'demote' | | NEW_TOKEN | new.jwt | JSON | Notifies when the token (jwt) is updated +## Webhook Routes +When enabling the WEBHOOK_BY_EVENTS options in the global and local webhooks, the following paths will be added at the end of the webhook. + +| Name | Route | +|------|-------| +| APPLICATION_STARTUP | https://url_webhook/application-startup | +| QRCODE_UPDATED | https://url_webhook/qrcode-updated | +| CONNECTION_UPDATE | https://url_webhook/connection-update | +| MESSAGES_SET | https://url_webhook/messages-set | +| MESSAGES_UPSERT | https://url_webhook/messages-upsert | +| MESSAGES_UPDATE | https://url_webhook/messages-update | +| SEND_MESSAGE | https://url_webhook/send-message | +| CONTACTS_SET | https://url_webhook/contacts-set | +| CONTACTS_UPSERT | https://url_webhook/contacts-upsert | +| CONTACTS_UPDATE | https://url_webhook/contacts-update | +| PRESENCE_UPDATE | https://url_webhook/presence-update | +| CHATS_SET | https://url_webhook/chats-set | +| CHATS_UPDATE | https://url_webhook/chats-update | +| CHATS_UPSERT | https://url_webhook/chats-upsert | +| GROUPS_UPSERT | https://url_webhook/groups-upsert | +| GROUPS_UPDATE | https://url_webhook/groups-update | +| GROUP_PARTICIPANTS_UPDATE | https://url_webhook/groups-participants-update | +| NEW_TOKEN | https://url_webhook/new-token | ## Env File See additional settings that can be applied through the **env** file by clicking **[here](./src/dev-env.yml)**. @@ -254,8 +274,6 @@ This code was produced based on the baileys library and it is still under develo # Donate to the project. -#### Pix: 2b526ada-4ef4-4db4-bbeb-f60da2421fce - #### PicPay
diff --git a/docker.sh b/docker.sh new file mode 100644 index 00000000..43f1952d --- /dev/null +++ b/docker.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +NET='evolution-net' +IMAGE='evolution/api:local' + +if !(docker network ls | grep ${NET} > /dev/null) +then + docker network create -d bridge ${NET} +fi + +sudo mkdir -p /data/instances + +docker build -t ${IMAGE} . + +docker run -d --restart 'always' --name 'evolution_api' --mount 'type=bind,source=/data/instances,target=/evolution/instances' --publish '8083:8083' --hostname 'evolution' --network ${NET} ${IMAGE} \ No newline at end of file diff --git a/public/images/code.png b/public/images/code.png index 1eb9306b..50b28986 100644 Binary files a/public/images/code.png and b/public/images/code.png differ diff --git a/public/images/codechat-logo.png b/public/images/codechat-logo.png index af8054b2..bd9b3850 100644 Binary files a/public/images/codechat-logo.png and b/public/images/codechat-logo.png differ diff --git a/public/images/cover.png b/public/images/cover.png index 3b4c1fa5..f3d48bc8 100644 Binary files a/public/images/cover.png and b/public/images/cover.png differ diff --git a/public/images/n8n-codechat-wapi.png b/public/images/n8n-codechat-wapi.png deleted file mode 100644 index caa7b6e0..00000000 Binary files a/public/images/n8n-codechat-wapi.png and /dev/null differ