fix: readme
66
README.md
@ -1,18 +1,15 @@
|
||||
<h1 align="center">Evolution Api</h1>
|
||||
<!--
|
||||
</br>
|
||||
<hr style="height: 5px;background: #007500;margin: 20px 0;box-shadow: 0px 3px 5px 0px rgb(204 204 204);">-->
|
||||
|
||||
<!-- <div align="center"> -->
|
||||
<div align="center">
|
||||
|
||||
<!-- [](#)
|
||||
[](#)
|
||||
<!-- [](#)-->
|
||||
<!-- [](#) -->
|
||||
[](./LICENSE)
|
||||
[](https://app.picpay.com/user/davidsongomes1998) -->
|
||||
[](https://app.picpay.com/user/davidsongomes1998)
|
||||
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div align="center"><img src="./public/images/cover.png"></div>-> -->
|
||||
<div align="center"><img src="./public/images/cover.png"></div>
|
||||
|
||||
## 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.</br>
|
||||
@ -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 <br></br>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</br>'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
|
||||
|
||||
<div align="center">
|
||||
|
15
docker.sh
Normal file
@ -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}
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 36 KiB |