Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1a579372d | ||
|
|
16cd247db8 | ||
|
|
872d6d9880 | ||
|
|
79fe322d69 | ||
|
|
fe6f1cb547 | ||
|
|
8d7fcd0b84 | ||
|
|
46b0c3cee2 | ||
|
|
1ad9c3017c | ||
|
|
5d320fa22f | ||
|
|
5e1d9b6463 | ||
|
|
175dfde0b8 | ||
|
|
87717ae214 | ||
|
|
111c8f3160 | ||
|
|
6c756352cf | ||
|
|
97a5d11c1f | ||
|
|
44415d824e | ||
|
|
286e8f3afe | ||
|
|
4c2e3db2d5 | ||
|
|
6faf699fcc | ||
|
|
80b765e56a | ||
|
|
3f9ebe5c8c | ||
|
|
481371fd03 | ||
|
|
36c2165fc3 | ||
|
|
36402626e0 | ||
|
|
40c39e61e1 | ||
|
|
4e1b13e776 | ||
|
|
7f355ff43a | ||
|
|
22df449013 | ||
|
|
68303f5124 | ||
|
|
33babfef6b | ||
|
|
910a9185c7 | ||
|
|
f5bd74dfa1 | ||
|
|
b982640c85 | ||
|
|
245bcc46ed | ||
|
|
08a346bfa1 | ||
|
|
0cb4dd6d63 | ||
|
|
1a7a78cc51 | ||
|
|
9b69875b78 | ||
|
|
999ae4782b | ||
|
|
3c61ca8c94 | ||
|
|
0790e0a0ef | ||
|
|
0a2d77b699 | ||
|
|
051ada3f21 | ||
|
|
faf8d053dd | ||
|
|
5ece56f9b0 | ||
|
|
c4d9474f34 | ||
|
|
3b8481ccac | ||
|
|
a31d0215f5 | ||
|
|
f6cce68553 | ||
|
|
636b100b9f | ||
|
|
7a3574eaa0 | ||
|
|
9cd6176e60 | ||
|
|
f2641029cb | ||
|
|
6350e191f8 | ||
|
|
c570ba3488 | ||
|
|
b64abd24c8 | ||
|
|
13c9ab3962 | ||
|
|
b9f1c6ee79 | ||
|
|
938170a957 | ||
|
|
ca0a28c0cf | ||
|
|
c3967173a1 | ||
|
|
9ebbd9a1fd | ||
|
|
16e343ca19 | ||
|
|
1de9132f16 | ||
|
|
dad54a8e47 | ||
|
|
7d73b96b78 | ||
|
|
1260fe34aa | ||
|
|
3b4678e059 | ||
|
|
ff8294b5db | ||
|
|
7e94e19f5d | ||
|
|
ae18e2575a | ||
|
|
a5c493a29c | ||
|
|
8ee89fe51c | ||
|
|
b4909847bf | ||
|
|
568be88127 | ||
|
|
67144c1d08 | ||
|
|
285c78d41a | ||
|
|
7d15735444 | ||
|
|
4191749564 | ||
|
|
9e68dbbf09 | ||
|
|
f02ad5b051 | ||
|
|
08e20a25ed | ||
|
|
ee0468038d | ||
|
|
04afc297d9 | ||
|
|
ed06ca76e0 | ||
|
|
a68510a814 | ||
|
|
4040efab01 | ||
|
|
f08cc1061e | ||
|
|
3b5b11891e | ||
|
|
72427c9309 | ||
|
|
befe2068fd | ||
|
|
c7a3ef32fa | ||
|
|
51d394f4ef | ||
|
|
8db341dd70 | ||
|
|
5cd7fec3ab | ||
|
|
f672ecbb45 | ||
|
|
9a12b2c9b6 | ||
|
|
c31407fd87 | ||
|
|
646c81f136 | ||
|
|
aca6232d2a | ||
|
|
c61da10523 | ||
|
|
1f53d65ac2 | ||
|
|
844ab1287e | ||
|
|
d6d318b23b | ||
|
|
7504ffd934 | ||
|
|
e8078908c9 | ||
|
|
431848280f | ||
|
|
2e0c575512 | ||
|
|
ebf0d99417 | ||
|
|
423d893fee | ||
|
|
56fe0d3b04 | ||
|
|
7172d9d203 | ||
|
|
bd770a6902 | ||
|
|
628508faed | ||
|
|
826634f061 | ||
|
|
c7ed959a71 | ||
|
|
aea6befc1e | ||
|
|
7bb3484788 | ||
|
|
4eafc67a7e | ||
|
|
b5197b6f20 | ||
|
|
d306304195 | ||
|
|
35f47dae4f | ||
|
|
f1be4810d5 | ||
|
|
d4f9406869 | ||
|
|
a41b81d724 | ||
|
|
da56b86102 | ||
|
|
f12d2c9be0 | ||
|
|
322b9b4c25 | ||
|
|
fb7fe410f9 | ||
|
|
ee392a079c | ||
|
|
0502579d50 | ||
|
|
f10f3175d9 | ||
|
|
f155af99f1 | ||
|
|
0fbf3575a6 | ||
|
|
f6b9b5f54e | ||
|
|
2dadd9d8c9 | ||
|
|
5786b3cdfe | ||
|
|
769fc30c0c | ||
|
|
fb2dad9c6f | ||
|
|
c43d308a2d | ||
|
|
742a12ce6a | ||
|
|
d953f27865 | ||
|
|
4719cded95 | ||
|
|
9d489bdb69 | ||
|
|
537c307550 | ||
|
|
d5575e0323 | ||
|
|
592962bbc8 | ||
|
|
7a371c86dc | ||
|
|
0e295bebde | ||
|
|
8d98759be6 | ||
|
|
924317b01b | ||
|
|
a08a601dc3 | ||
|
|
e652c15d6c | ||
|
|
4534eb60de | ||
|
|
54c6c0c24c | ||
|
|
393694ae96 | ||
|
|
818bb730e4 | ||
|
|
61bd35a192 | ||
|
|
81f9df000a | ||
|
|
0dcb31c108 | ||
|
|
cd4140fda9 | ||
|
|
117cc25cdb | ||
|
|
832ad26151 | ||
|
|
5a344cd8ad | ||
|
|
0b0a67cdad | ||
|
|
a326a240f0 | ||
|
|
dfdb033769 | ||
|
|
a31af45d97 | ||
|
|
cae955c483 | ||
|
|
0bfff5259e | ||
|
|
0fa83e603b | ||
|
|
906b03804f | ||
|
|
1ed7a61bea | ||
|
|
ad6ae7ab05 | ||
|
|
5e2de1d47d | ||
|
|
591ca51104 | ||
|
|
b210841158 | ||
|
|
a223a3985b | ||
|
|
8baa6a73cd | ||
|
|
508efac2ea | ||
|
|
b6eed9e228 | ||
|
|
b62cad07f0 | ||
|
|
6d552d27ac | ||
|
|
39d0f2a060 | ||
|
|
0b03abee91 | ||
|
|
b4fb69d0ee | ||
|
|
5b9ed029b3 | ||
|
|
c29397371b | ||
|
|
fe47e27788 | ||
|
|
a14c702c79 | ||
|
|
fe4246036d | ||
|
|
074063b814 | ||
|
|
0271a8b721 | ||
|
|
08617383be | ||
|
|
3840459b0a | ||
|
|
aee7ac28bc | ||
|
|
9e6cd39b2d | ||
|
|
8898429046 | ||
|
|
a74def6dbd | ||
|
|
9f783cd35e | ||
|
|
9d2f061d81 | ||
|
|
a6045b2d54 | ||
|
|
6142b2b564 | ||
|
|
ed53ccb919 | ||
|
|
1ab45c6cfd | ||
|
|
c2fdb090e1 | ||
|
|
a10b47eb7e | ||
|
|
7b234e2e37 | ||
|
|
90d45a4698 | ||
|
|
5e40b70e19 | ||
|
|
a27d0c3efb | ||
|
|
46ed506b35 | ||
|
|
0ad813a1fe | ||
|
|
e57e42f47a | ||
|
|
cc58157d37 | ||
|
|
9b5bb0a339 | ||
|
|
84ebbea287 | ||
|
|
1c2021f54b | ||
|
|
98a7f00d7d | ||
|
|
60d97d0e67 | ||
|
|
03f4a07cbe | ||
|
|
3fbe526793 | ||
|
|
a892f03382 | ||
|
|
8db69f6e69 | ||
|
|
f9037ff9fc | ||
|
|
366ddffa2b | ||
|
|
b8468588de | ||
|
|
62dd6f7f4a | ||
|
|
858202f1bb | ||
|
|
db7900dc26 | ||
|
|
aa87e437dc | ||
|
|
741e5e86f8 | ||
|
|
390a171891 | ||
|
|
1fc5e2b47c | ||
|
|
8926dc7cc6 | ||
|
|
5c3d3c0d70 | ||
|
|
41b29cbf60 | ||
|
|
44463c199a | ||
|
|
9071adcdcc | ||
|
|
21cd92ca13 | ||
|
|
d8a3e8dc43 | ||
|
|
3f5707952c | ||
|
|
38a9590be0 | ||
|
|
a7ce117b87 | ||
|
|
c3b24a243c | ||
|
|
cb2c11df43 | ||
|
|
98f88dcf68 | ||
|
|
9fb12e0e23 | ||
|
|
0ca106f16b | ||
|
|
33210c6374 | ||
|
|
045ab67f5d | ||
|
|
19259c93ea | ||
|
|
9b6784a018 | ||
|
|
2fe3706e9c | ||
|
|
a4e310a7f8 | ||
|
|
802da9f3b2 | ||
|
|
0692979b19 | ||
|
|
fb8b146bc4 | ||
|
|
fdbaa43ec9 | ||
|
|
4a807530c1 | ||
|
|
84784faa1e | ||
|
|
bd40978dee | ||
|
|
d4d94ffe0e | ||
|
|
d984382a33 | ||
|
|
02d05812d2 | ||
|
|
1dbf568bac | ||
|
|
6bc3aed348 | ||
|
|
c1e8e0f09c | ||
|
|
8f8bcfc474 | ||
|
|
b386df982d | ||
|
|
fa846ddf9b | ||
|
|
16685ed8ea | ||
|
|
4addccbd55 | ||
|
|
e9a20c4326 | ||
|
|
f073aeef13 | ||
|
|
eb08739eea | ||
|
|
aff3b01e39 | ||
|
|
2d64b26e86 | ||
|
|
7b7bd02503 | ||
|
|
7904516c97 | ||
|
|
6e0bafdd89 | ||
|
|
2b1e605e5f | ||
|
|
f454310a09 | ||
|
|
b6579b5b96 | ||
|
|
4ef06d7b92 | ||
|
|
e0c594a71b | ||
|
|
a48d386d8b | ||
|
|
d592858a90 | ||
|
|
a3cb3e983a | ||
|
|
4eb9029b2c | ||
|
|
b3835b0aa0 | ||
|
|
b2db58a922 | ||
|
|
acb6b8e0d3 | ||
|
|
21c6e1e860 | ||
|
|
571b65c423 | ||
|
|
1631a62abe | ||
|
|
e88a7ca8ce | ||
|
|
d54f64a9cc | ||
|
|
03dbd5db82 | ||
|
|
2446c292bf | ||
|
|
5ab99dfd69 | ||
|
|
605f46fda8 | ||
|
|
e53f1eafe8 | ||
|
|
1457185e84 | ||
|
|
ad43bec18d | ||
|
|
c0a4b223ea | ||
|
|
65917e1957 | ||
|
|
a19cede60d | ||
|
|
a3ead95ea4 | ||
|
|
c46bc1b923 | ||
|
|
b327212cbe | ||
|
|
4f348c7e48 | ||
|
|
f2d0001b11 | ||
|
|
66a224a0e3 | ||
|
|
1fa1206568 | ||
|
|
87eea28ac2 | ||
|
|
29ca0217b3 | ||
|
|
306f75ff3b | ||
|
|
6ecb203570 | ||
|
|
2e7a3a6b61 | ||
|
|
86bc4a92ba | ||
|
|
f652277e18 | ||
|
|
14a3535439 | ||
|
|
edce7424de | ||
|
|
0fa121bbe2 | ||
|
|
9c046a92be | ||
|
|
e4506e14da | ||
|
|
515a00346c | ||
|
|
399e27e24e | ||
|
|
9413376138 | ||
|
|
3caec14783 | ||
|
|
6e427a0a34 | ||
|
|
40c5e95d93 | ||
|
|
ab70e27266 | ||
|
|
301b6f57d3 | ||
|
|
4c9f5ed907 | ||
|
|
04d65150ed | ||
|
|
d29165c9a5 | ||
|
|
30db175d52 | ||
|
|
5c666c0dd4 | ||
|
|
3ccc0469c0 | ||
|
|
5ab3244d6a | ||
|
|
05bc8abbee | ||
|
|
8e9056a0cd | ||
|
|
ea75b357a7 | ||
|
|
2b607e9b44 | ||
|
|
57d3528a96 | ||
|
|
660a04aa52 | ||
|
|
d0a408001d | ||
|
|
48391533a6 | ||
|
|
f2113adbbc |
No files matched your search
@@ -1,33 +1,36 @@
|
||||
module.exports = {
|
||||
parser: "@typescript-eslint/parser",
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: "tsconfig.json",
|
||||
sourceType: "module"
|
||||
project: 'tsconfig.json',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: [
|
||||
"@typescript-eslint/eslint-plugin",
|
||||
"simple-import-sort"
|
||||
],
|
||||
plugins: ['@typescript-eslint/eslint-plugin', 'simple-import-sort'],
|
||||
extends: [
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier",
|
||||
"prettier/@typescript-eslint"
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
'prettier/@typescript-eslint',
|
||||
],
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
jest: true
|
||||
jest: true,
|
||||
},
|
||||
rules: {
|
||||
"simple-import-sort/imports": "error",
|
||||
"simple-import-sort/exports": "error",
|
||||
"@typescript-eslint/interface-name-prefix": "off",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/ban-ts-ignore": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
}
|
||||
'simple-import-sort/imports': 'error',
|
||||
'simple-import-sort/exports': 'error',
|
||||
'@typescript-eslint/interface-name-prefix': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-inferrable-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/ban-ts-ignore': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'lines-between-class-members': [
|
||||
'error',
|
||||
'always',
|
||||
{ exceptAfterSingleLine: true },
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: wa_http_api
|
||||
open_collective: # doks Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom:
|
||||
- https://boosty.to/wa-http-api
|
||||
- https://portal.devlike.pro/
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: '[BUG][WEBJS] - '
|
||||
labels: bug
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
> A clear and concise description of what the bug is. Feel free to remove
|
||||
> sections that you don't feel to make the text shorter!
|
||||
|
||||
**Version**
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "2023.11.1",
|
||||
"engine": "NOWEB",
|
||||
"tier": "PLUS",
|
||||
"browser": "/usr/bin/google-chrome-stable"
|
||||
}
|
||||
```
|
||||
|
||||
> You can get the WAHA version by calling `GET /api/version` Try to update to
|
||||
> [the latest version](https://github.com/devlikeapro/whatsapp-http-api/releases)
|
||||
> before creating an issue!
|
||||
|
||||
**To Reproduce** Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
|
||||
> A clear and concise description of what you expected to happen.
|
||||
|
||||
**Engine** I'm using **WEBJS** engine.
|
||||
|
||||
> If you set `WHATSAPP_DEFAULT_ENGINE` explicitly to
|
||||
> [one of the engine](https://waha.devlike.pro/docs/how-to/engines/) - please
|
||||
> provide that information here and in the issue title.
|
||||
|
||||
**Requests - Responses**
|
||||
|
||||
> Please attach all sent requests, responses that you sent.
|
||||
|
||||
**Docker Logs**
|
||||
|
||||
> Collect and attach related docker logs if you have any
|
||||
> https://waha.devlike.pro/docs/how-to/deploy/#viewing-the-logs
|
||||
|
||||
**Screenshots**
|
||||
|
||||
> If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
|
||||
> Add any other context about the problem here.
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: '[Feature Request]'
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.** I'm always
|
||||
frustrated when [...]
|
||||
|
||||
> A clear and concise description of what the problem is. Ex.
|
||||
|
||||
**Describe the solution you'd like**
|
||||
|
||||
> A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
|
||||
> A clear and concise description of any alternative solutions or features
|
||||
> you've considered.
|
||||
|
||||
**Additional context** Add any other context or screenshots about the feature
|
||||
request here.
|
||||
@@ -0,0 +1,10 @@
|
||||
teamLabels:
|
||||
- team: waha-patrons-pro
|
||||
label: patron:PRO
|
||||
comment: '[](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
|
||||
- team: waha-patrons-advanced
|
||||
label: patron:ADVANCED
|
||||
comment: '[](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
|
||||
- team: waha-patrons-plus
|
||||
label: patron:PLUS
|
||||
comment: '[](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
|
||||
@@ -3,21 +3,47 @@ name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
deploy-docker:
|
||||
runs-on: ubuntu-latest
|
||||
docker-build:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
name: ${{ matrix.platform }} - ${{ matrix.browser }} - ${{ matrix.tag }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# Chromium
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'latest'
|
||||
platform: 'amd64'
|
||||
browser: 'chromium'
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
tag: 'arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'chromium'
|
||||
# Chrome
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'chrome'
|
||||
platform: 'amd64'
|
||||
browser: 'chrome'
|
||||
# Chrome is not supported on arm64
|
||||
# - runner: "buildjet-4vcpu-ubuntu-2204-arm"
|
||||
# tag: "chrome-arm"
|
||||
# platform: "linux/arm64"
|
||||
# browser: "chrome"
|
||||
# No browser
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'noweb'
|
||||
platform: 'amd64'
|
||||
browser: 'none'
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
tag: 'noweb-arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'none'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
with:
|
||||
platforms: 'amd64'
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
@@ -25,10 +51,10 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ secrets.DOCKER_IMAGE }}
|
||||
flavor: latest=true
|
||||
images: ${{ vars.DOCKER_IMAGE }}
|
||||
flavor: latest=false
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=raw,value=${{ matrix.tag }}
|
||||
|
||||
- name: Login to image repository
|
||||
if: github.ref_type == 'tag'
|
||||
@@ -42,7 +68,9 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: 'amd64'
|
||||
platforms: ${{ matrix.platform }}
|
||||
build-args: |
|
||||
USE_BROWSER=${{ matrix.browser }}
|
||||
push: ${{ github.ref_type == 'tag' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -0,0 +1,84 @@
|
||||
name: Manual push
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Tag to push'
|
||||
required: true
|
||||
default: 'dev'
|
||||
push:
|
||||
description: 'Push to registry'
|
||||
required: true
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
jobs:
|
||||
docker-build:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
name: ${{ matrix.platform }} - ${{ matrix.browser }} - ${{ matrix.tag }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# Chromium
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'latest'
|
||||
platform: 'amd64'
|
||||
browser: 'chromium'
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
tag: 'arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'chromium'
|
||||
# Chrome
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'chrome'
|
||||
platform: 'amd64'
|
||||
browser: 'chrome'
|
||||
# Chrome is not supported on arm64
|
||||
# - runner: "buildjet-4vcpu-ubuntu-2204-arm"
|
||||
# tag: "chrome-arm"
|
||||
# platform: "linux/arm64"
|
||||
# browser: "chrome"
|
||||
# No browser
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'noweb'
|
||||
platform: 'amd64'
|
||||
browser: 'none'
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
tag: 'noweb-arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'none'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ vars.DOCKER_IMAGE }}
|
||||
flavor: latest=false
|
||||
tags: |
|
||||
type=raw,value=${{ inputs.tag }}-${{ matrix.tag }}
|
||||
|
||||
- name: Login to image repository
|
||||
if: github.ref_type == 'tag'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
build-args: |
|
||||
USE_BROWSER=${{ matrix.browser }}
|
||||
push: ${{ inputs.push }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -1,13 +1,26 @@
|
||||
exclude: '^src/dashboard'
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: 'v2.7.1'
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: prettier
|
||||
types_or: [ javascript, ts ]
|
||||
- id: lint
|
||||
name: lint
|
||||
language: system
|
||||
entry: bash -c '$HOME/.nvm/nvm-exec npm run lint'
|
||||
pass_filenames: false
|
||||
files: |
|
||||
(?x)^(
|
||||
src/.*|
|
||||
)$
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: 'v3.1.0'
|
||||
hooks:
|
||||
- id: prettier
|
||||
exclude: |
|
||||
(?x)^(
|
||||
docs/.*|
|
||||
README.md|
|
||||
)$
|
||||
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
|
||||
rev: v1.1.2
|
||||
hooks:
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "auto",
|
||||
"arrowParens": "always",
|
||||
"bracketSpacing": true,
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"semi": true,
|
||||
"quoteProps": "as-needed",
|
||||
"proseWrap": "always",
|
||||
"printWidth": 80
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.6.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-3.6.3.cjs
|
||||
@@ -1,2 +1,4 @@
|
||||
# Changelog
|
||||
You can find changelog on [the changelog page](https://waha.devlike.pro/docs/help/changelog/)
|
||||
|
||||
You can find changelog on
|
||||
[the changelog page](https://waha.devlike.pro/docs/help/changelog/)
|
||||
@@ -5,16 +5,21 @@ FROM node:20-bullseye as build
|
||||
ENV PUPPETEER_SKIP_DOWNLOAD=True
|
||||
|
||||
# npm packages
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y openssh-client
|
||||
RUN apt install openssh-client
|
||||
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||
|
||||
WORKDIR /src
|
||||
COPY package.json .
|
||||
COPY yarn.lock .
|
||||
RUN yarn set version 3.6.1
|
||||
RUN yarn install
|
||||
RUN yarn set version 3.6.3
|
||||
RUN --mount=type=ssh yarn install
|
||||
|
||||
# App
|
||||
WORKDIR /src
|
||||
ADD . /src
|
||||
RUN yarn install
|
||||
RUN --mount=type=ssh yarn install
|
||||
RUN yarn build && find ./dist -name "*.d.ts" -delete
|
||||
|
||||
#
|
||||
@@ -24,11 +29,15 @@ FROM node:20-bullseye as release
|
||||
ENV PUPPETEER_SKIP_DOWNLOAD=True
|
||||
ARG USE_BROWSER=chromium
|
||||
|
||||
# Install fonts
|
||||
RUN apt-get update \
|
||||
RUN echo "USE_BROWSER=$USE_BROWSER"
|
||||
|
||||
# Install fonts if using either chromium or chrome
|
||||
RUN if [ "$USE_BROWSER" = "chromium" ] || [ "$USE_BROWSER" = "chrome" ]; then \
|
||||
apt-get update \
|
||||
&& apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
|
||||
--no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# Install Chromium
|
||||
RUN if [ "$USE_BROWSER" = "chromium" ]; then \
|
||||
|
||||
@@ -1,9 +1,24 @@
|
||||
build:
|
||||
docker build . -t devlikeapro/whatsapp-http-api
|
||||
|
||||
build-chrome:
|
||||
docker build . -t devlikeapro/whatsapp-http-api:chrome --build-arg USE_BROWSER=chrome
|
||||
|
||||
build-noweb:
|
||||
docker build . -t devlikeapro/whatsapp-http-api:noweb --build-arg USE_BROWSER=none
|
||||
|
||||
build-all: build build-chrome build-noweb
|
||||
|
||||
build-plus:
|
||||
docker build . -t devlikeapro/whatsapp-http-api-plus
|
||||
|
||||
build-ssh:
|
||||
# check IMAGE provided
|
||||
@[ "${IMAGE}" ] || ( echo "Add APP: make build-ssh image=devlikeapro/whatsapp-http-api"; exit 1 );
|
||||
eval $(ssh-agent) && \
|
||||
ssh-add ~/.ssh/id_rsa && \
|
||||
docker buildx build --ssh default=${SSH_AUTH_SOCK} . -t ${IMAGE} --build-arg USE_BROWSER=none
|
||||
|
||||
stop:
|
||||
docker stop whatsapp-http-api
|
||||
|
||||
@@ -20,7 +35,7 @@ update-swagger:
|
||||
wget http://localhost:3000/-json -O ./docs/site/static/swagger/openapi.json
|
||||
|
||||
update-dependencies:
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up whatsapp-web.js@https://github.com/pedroslopez/whatsapp-web.js
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js#main-fork
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up @adiwajshing/baileys@github:WhiskeySockets/Baileys
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up venom-bot
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<img src="./docs/site/static/images/logo.png" alt="Image" />
|
||||
</p>
|
||||
|
||||
**WAHA** - **W**hats**A**pp **H**TTP **A**PI that you can install on your own server and run in less than 5 minutes!
|
||||
**WAHA** - **W**hats**A**pp **H**TTP **A**PI (REST API) that you can install on your own server and run in less than 5 minutes!
|
||||
|
||||
- Documentation: [https://waha.devlike.pro/](https://waha.devlike.pro/)
|
||||
- Swagger Example: [https://waha.devlike.pro/swagger](https://waha.devlike.pro/swagger)
|
||||
@@ -40,7 +40,6 @@
|
||||
- Receive messages
|
||||
- Message replies
|
||||
- Send location
|
||||
- Send buttons
|
||||
- Receive location
|
||||
- React to messages
|
||||
- Send media (images/documents/files)
|
||||
@@ -110,7 +109,7 @@ docker pull devlikeapro/whatsapp-http-api
|
||||
 For Plus version, we use login to get the image before:
|
||||
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ services:
|
||||
image: devlikeapro/whatsapp-http-api
|
||||
container_name: whatsapp-http-api
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
- '3000:3000/tcp'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
- WHATSAPP_HOOK_URL=https://httpbin.org/post
|
||||
@@ -16,17 +16,57 @@ services:
|
||||
image: devlikeapro/whatsapp-http-api-plus
|
||||
container_name: whatsapp-http-api-plus
|
||||
ports:
|
||||
- "3000:3000/tcp"
|
||||
- '3000:3000/tcp'
|
||||
volumes:
|
||||
- "./.sessions:/app/.sessions"
|
||||
- './.sessions:/app/.sessions'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
- WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
- WHATSAPP_HOOK_URL=https://httpbin.org/post
|
||||
- WHATSAPP_HOOK_EVENTS=message
|
||||
# - WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
# - WHATSAPP_HOOK_URL=https://httpbin.org/post
|
||||
# - WHATSAPP_HOOK_EVENTS=message
|
||||
# - WHATSAPP_API_HOSTNAME=localhost
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
- WHATSAPP_API_KEY=321
|
||||
- WHATSAPP_SWAGGER_USERNAME=admin
|
||||
- WHATSAPP_SWAGGER_PASSWORD=123
|
||||
- WHATSAPP_API_HOSTNAME=localhost
|
||||
# Username and password for Swagger
|
||||
- WHATSAPP_SWAGGER_USERNAME=swagger
|
||||
- WHATSAPP_SWAGGER_PASSWORD=admin
|
||||
# Username and password for WAHA Dashboard
|
||||
# you can use the same username and password for both Swagger and Dashboard
|
||||
# Default - waha / waha
|
||||
- WAHA_DASHBOARD_USERNAME=waha
|
||||
- WAHA_DASHBOARD_PASSWORD=waha
|
||||
restart: always
|
||||
|
||||
whatsapp-http-api-plus--mongodb:
|
||||
image: devlikeapro/whatsapp-http-api-plus
|
||||
container_name: whatsapp-http-api-plus--mongodb
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
# - WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
# - WHATSAPP_HOOK_URL=https://httpbin.org/post
|
||||
# - WHATSAPP_HOOK_EVENTS=message
|
||||
# - WHATSAPP_API_KEY=321
|
||||
# - WHATSAPP_SWAGGER_USERNAME=admin
|
||||
# - WHATSAPP_SWAGGER_PASSWORD=123
|
||||
# - WAHA_DASHBOARD_USERNAME=admin
|
||||
# - WAHA_DASHBOARD_PASSWORD=123
|
||||
# - WHATSAPP_API_HOSTNAME=localhost
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
- WHATSAPP_SESSIONS_MONGO_URL=mongodb://mongodb:27017
|
||||
restart: always
|
||||
|
||||
mongodb:
|
||||
image: mongo
|
||||
container_name: mongodb
|
||||
ports:
|
||||
- '27017:27017/tcp'
|
||||
volumes:
|
||||
- mongodb_data:/data/db
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
mongodb_data: {}
|
||||
@@ -78,9 +78,9 @@
|
||||
parent = "waha-plus"
|
||||
|
||||
[[main]]
|
||||
name = "Get on Boosty ->"
|
||||
weight = 50
|
||||
url = "https://boosty.to/wa-http-api"
|
||||
name = "Patron Portal ->"
|
||||
weight = 20
|
||||
url = "https://portal.devlike.pro/"
|
||||
parent = "waha-plus"
|
||||
|
||||
[[main]]
|
||||
@@ -89,6 +89,13 @@
|
||||
url = "https://patreon.com/wa_http_api"
|
||||
parent = "waha-plus"
|
||||
|
||||
[[main]]
|
||||
name = "Get on Boosty ->"
|
||||
weight = 50
|
||||
url = "https://boosty.to/wa-http-api"
|
||||
parent = "waha-plus"
|
||||
|
||||
|
||||
[[main]]
|
||||
name = "Examples"
|
||||
weight = 20
|
||||
@@ -97,9 +104,14 @@
|
||||
[[main]]
|
||||
name = "Python ->"
|
||||
weight = 21
|
||||
url = "https://github.com/devlikeapro/whatsapp-http-api/tree/core/examples/python"
|
||||
url = "/docs/examples/python"
|
||||
parent = "examples"
|
||||
|
||||
[[main]]
|
||||
name = "Kotlin ->"
|
||||
weight = 22
|
||||
url = "/docs/examples/kotlin"
|
||||
parent = "examples"
|
||||
|
||||
[[social]]
|
||||
name = "GitHub"
|
||||
|
||||
@@ -73,7 +73,7 @@ copyRight = "Copyright (c) 2021-2023 Dev Like A Pro"
|
||||
# Alert
|
||||
alert = true
|
||||
alertDismissable = true
|
||||
alertText = "<a class=\"alert-link stretched-link\" href=\"https://waha.devlike.pro/docs/how-to/plus-version/\">Support the project and get WAHA Plus version! -></a>"
|
||||
alertText = "📢 <a class=\"alert-link stretched-link\" href=\"https://waha.devlike.pro/docs/how-to/waha-dashboard/\">WAHA Dashboard - UI to manage your WhatsApp sessions!</a> 📢"
|
||||
|
||||
# Edit Page
|
||||
# repoHost [Github | Gitea | GitLab | Bitbucket | BitbucketServer ] is used for building the edit link based on git hoster
|
||||
@@ -81,8 +81,8 @@ repoHost = "GitHub"
|
||||
#repoHost = "Gitea"
|
||||
docsRepo = "https://github.com/devlikeapro/whatsapp-http-api"
|
||||
docsRepoBranch = "core"
|
||||
docsRepoSubPath = ""
|
||||
editPage = false
|
||||
docsRepoSubPath = "docs/site"
|
||||
editPage = true
|
||||
lastMod = false
|
||||
|
||||
[sections]
|
||||
@@ -95,7 +95,7 @@ lastMod = false
|
||||
flexSearch = true
|
||||
searchSectionsShow = []
|
||||
searchSectionsIndex = []
|
||||
darkMode = true
|
||||
darkMode = false
|
||||
bootStrapJs = true
|
||||
breadCrumb = false
|
||||
highLight = true
|
||||
@@ -110,4 +110,4 @@ lastMod = false
|
||||
[menu]
|
||||
[menu.section]
|
||||
auto = true
|
||||
collapsibleSidebar = true
|
||||
collapsibleSidebar = false
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title : "WAHA"
|
||||
description: "WAHA - WhatsApp HTTP API that you can run in a click!"
|
||||
lead: "WAHA - WhatsApp HTTP API that you can run in a click!"
|
||||
lead: "WAHA - <b>WhatsApp HTTP API</b> that you can run in a click!"
|
||||
date: 2020-10-06T08:47:36+00:00
|
||||
lastmod: 2020-10-06T08:47:36+00:00
|
||||
draft: false
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
---
|
||||
title: "Kotlin"
|
||||
description: "WhatsApp HTTP API + Kotlin examples."
|
||||
lead: "WhatsApp HTTP API + Kotlin examples."
|
||||
date: 2020-10-06T08:49:31+00:00
|
||||
lastmod: 2020-10-06T08:49:31+00:00
|
||||
draft: false
|
||||
images: ["/images/kotlin-whatsapp.png"]
|
||||
menu:
|
||||
docs:
|
||||
parent: "help"
|
||||
weight: 630
|
||||
toc: true
|
||||
---
|
||||
|
||||

|
||||
|
||||
We've created a few examples on how to interact with WAHA WhatsApp HTTP API with Kotlin (ktor).
|
||||
|
||||
You can find the examples in
|
||||
[examples folder on GitHub with detailed instructions in README.md ->](https://github.com/devlikeapro/waha-kotlin)
|
||||
|
||||
## Installation
|
||||
|
||||
We assume that you have installed software:
|
||||
|
||||
1. Kotlin + JVM
|
||||
2. Docker
|
||||
|
||||
### Download and start image
|
||||
|
||||
First of all, you must run WhatsApp HTTP API locally (which under the hood it
|
||||
runs real WhatsApp Web instance and expose HTTP API for interaction).
|
||||
|
||||
Here are the steps from
|
||||
[Quick Start](https://waha.devlike.pro/docs/overview/quick-start/):
|
||||
|
||||
Download and start WhatsApp HTTP API docker container
|
||||
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
# Run the docker container
|
||||
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
|
||||
# It prints logs and the last line must be
|
||||
# WhatsApp HTTP API is running on: http://[::1]:3000
|
||||
```
|
||||
|
||||
#### Download image - ARM
|
||||
|
||||
If you're using ARM (like Apple Silicon, Apple M1, etc.) - use following
|
||||
commands to download the image
|
||||
|
||||
 For Core version the command is
|
||||
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api:arm
|
||||
# Rename it, so you can use devlikeapro/whatsapp-http-api image in other place
|
||||
docker tag devlikeapro/whatsapp-http-api:arm devlikeapro/whatsapp-http-api
|
||||
# Run the docker container
|
||||
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
|
||||
# It prints logs and the last line must be
|
||||
# WhatsApp HTTP API is running on: http://[::1]:3000
|
||||
```
|
||||
|
||||
### Start session and scan QR
|
||||
|
||||
2. Open Swagger API in the browser http://localhost:3000/
|
||||
3. Start session and scan QR code in swagger
|
||||
1. Find `POST /api/session/start` request press **Try it out** and
|
||||
**Execute** it with `default` session name
|
||||
2. Find `GET /api/screenshot` and execute it - it must show QR code
|
||||
3. Scan QR code on your mobile WhatsApp application (that installed on your
|
||||
phone)
|
||||
4. Execute `GET /api/screenshot` once again - it must show the screenshot
|
||||
from WhatsApp Web.
|
||||
4. Send test text message - find `POST /api/sendText` and execute it with
|
||||
payload (change `12132132130` in the `chatId` to phone number that is
|
||||
registered in WhatsApp).
|
||||
|
||||
```json
|
||||
{
|
||||
"chatId": "12132132130@c.us",
|
||||
"text": "Hi there!",
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
|
||||
If you see **Hi there!** message then you're ready to run bots!
|
||||
|
||||
## WhatsApp Echo Bot
|
||||
|
||||
The WhatsApp Echo Bot is a sample ktor webhook server application that echoes
|
||||
back to you whatever you send it. It can serve as a basic reference for how to
|
||||
set up webhooks and reply to incoming messages.
|
||||
|
||||
```bash
|
||||
# Clone the git repository with example
|
||||
git clone https://github.com/devlikeapro/waha-kotlin.git
|
||||
|
||||
# Build and run the app
|
||||
./gradlew build
|
||||
./gradlew run
|
||||
```
|
||||
|
||||
Open http://127.0.0.1:5000/bot - if you see **WhatsApp Echo Bot is ready!** then
|
||||
the bot is ready to receive message!
|
||||
|
||||
Send message to the WhatsApp (that you used to scan QR code) and it'll echo text
|
||||
back to you!
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
title: "Python"
|
||||
description: "WhatsApp HTTP API Python examples."
|
||||
lead: "WhatsApp HTTP API Python examples."
|
||||
date: 2020-10-06T08:49:31+00:00
|
||||
lastmod: 2020-10-06T08:49:31+00:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "help"
|
||||
weight: 630
|
||||
toc: true
|
||||
---
|
||||
We've created a few examples on how to interact with WAHA WhatsApp HTTP API with Python.
|
||||
|
||||
You can find the examples in [examples folder on GitHub with detailed instructions in README.md](https://github.com/devlikeapro/whatsapp-http-api/tree/core/examples/python)
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
---
|
||||
title: "Python"
|
||||
description: "WhatsApp HTTP API + Python examples."
|
||||
lead: "WhatsApp HTTP API + Python examples."
|
||||
date: 2020-10-06T08:49:31+00:00
|
||||
lastmod: 2020-10-06T08:49:31+00:00
|
||||
draft: false
|
||||
images: ["/images/python-whatsapp.png"]
|
||||
menu:
|
||||
docs:
|
||||
parent: "help"
|
||||
weight: 630
|
||||
toc: true
|
||||
---
|
||||
|
||||

|
||||
|
||||
We've created a few examples on how to interact with WAHA WhatsApp HTTP API with Python.
|
||||
|
||||
You can find the examples in [examples folder on GitHub with detailed instructions in README.md ->](https://github.com/devlikeapro/whatsapp-http-api/tree/core/examples/python)
|
||||
|
||||
## Installation
|
||||
|
||||
We assume that you have installed software:
|
||||
|
||||
1. Python 3
|
||||
2. Docker
|
||||
|
||||
### Download and start image
|
||||
|
||||
First of all, you must run WhatsApp HTTP API locally (which under the hood it
|
||||
runs real WhatsApp Web instance and expose HTTP API for interaction).
|
||||
|
||||
Here are the steps from
|
||||
[Quick Start](https://waha.devlike.pro/docs/overview/quick-start/):
|
||||
|
||||
Download and start WhatsApp HTTP API docker container
|
||||
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
# Run the docker container
|
||||
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
|
||||
# It prints logs and the last line must be
|
||||
# WhatsApp HTTP API is running on: http://[::1]:3000
|
||||
```
|
||||
|
||||
#### Download image - ARM
|
||||
|
||||
If you're using ARM (like Apple Silicon, Apple M1, etc.) - use following
|
||||
commands to download the image
|
||||
|
||||
 For Core version the command is
|
||||
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api:arm
|
||||
# Rename it, so you can use devlikeapro/whatsapp-http-api image in other place
|
||||
docker tag devlikeapro/whatsapp-http-api:arm devlikeapro/whatsapp-http-api
|
||||
# Run the docker container
|
||||
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
|
||||
# It prints logs and the last line must be
|
||||
# WhatsApp HTTP API is running on: http://[::1]:3000
|
||||
```
|
||||
|
||||
### Start session and scan QR
|
||||
|
||||
2. Open Swagger API in the browser http://localhost:3000/
|
||||
3. Start session and scan QR code in swagger
|
||||
1. Find `POST /api/session/start` request press **Try it out** and
|
||||
**Execute** it with `default` session name
|
||||
2. Find `GET /api/screenshot` and execute it - it must show QR code
|
||||
3. Scan QR code on your mobile WhatsApp application (that installed on your
|
||||
phone)
|
||||
4. Execute `GET /api/screenshot` once again - it must show the screenshot
|
||||
from WhatsApp Web.
|
||||
4. Send test text message - find `POST /api/sendText` and execute it with
|
||||
payload (change `12132132130` in the `chatId` to phone number that is
|
||||
registered in WhatsApp).
|
||||
|
||||
```json
|
||||
{
|
||||
"chatId": "12132132130@c.us",
|
||||
"text": "Hi there!",
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
|
||||
If you see **Hi there!** message then you're ready to run bots!
|
||||
|
||||
## WhatsApp Echo Bot
|
||||
|
||||
The WhatsApp Echo Bot is a sample flask webhook server application that echoes
|
||||
back to you whatever you send it. It can serve as a basic reference for how to
|
||||
set up webhooks and reply to incoming messages.
|
||||
|
||||
```bash
|
||||
# Clone the git repository with example
|
||||
git clone https://github.com/devlikeapro/whatsapp-http-api.git
|
||||
# Open python example folder
|
||||
cd whatsapp-http-api/examples/python
|
||||
# Install requirements
|
||||
python -mpip install -r requirements.txt
|
||||
# Run the bot
|
||||
FLASK_APP=whatsapp_echo_bot.py flask run
|
||||
```
|
||||
|
||||
Open http://127.0.0.1:5000/bot - if you see **WhatsApp Echo Bot is ready!** then
|
||||
the bot is ready to receive message!
|
||||
|
||||
Send message to the WhatsApp (that you used to scan QR code) and it'll echo text
|
||||
back to you!
|
||||
|
||||
## WhatsApp Download Files Bot
|
||||
|
||||
The WhatsApp Download Image Bot downloads all files people send to your WhatsApp
|
||||
and log the path for the file.
|
||||
|
||||
**The bot works only with WAHA Plus version** available with donations. Visit
|
||||
[read more about difference between Core and Plus versions](https://waha.devlike.pro/docs/how-to/plus-version/).
|
||||
|
||||
Download **WAHA Plus** version:
|
||||
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
# Run the docker container
|
||||
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name whatsapp-http-api devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
Run the WhatsApp Download Files bot:
|
||||
|
||||
```bash
|
||||
# Clone the git repository with example
|
||||
git clone https://github.com/devlikeapro/whatsapp-http-api.git
|
||||
# Open python example folder
|
||||
cd whatsapp-http-api/examples/python
|
||||
# Install requirements
|
||||
python -mpip install -r requirements.txt
|
||||
# Run the bot
|
||||
FLASK_APP=whatsapp_download_files_bot.py flask run
|
||||
```
|
||||
|
||||
Open http://127.0.0.1:5000/bot - if you see **WhatsApp Download Files Bot!**
|
||||
then the bot is ready to receive message with files!
|
||||
|
||||
@@ -6,7 +6,7 @@ date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 126
|
||||
weight: 127
|
||||
---
|
||||
|
||||
Chats methods.
|
||||
@@ -15,7 +15,9 @@ Parameters in path that you can find in below endpoints:
|
||||
- `{session}` - use the session name for Whatsapp instance that you created with `POST /api/session/start` endpoint
|
||||
- `{chatId}` - chat id in format `123123123123@[c.us|g.us]`, `c.us` for direct chats and `g.us` for groups.
|
||||
|
||||
## Methods
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Get all chats
|
||||
Get all chats
|
||||
`GET /api/{session}/chats`
|
||||
|
||||
@@ -26,6 +26,7 @@ The following environment variables can be used to configure the WAHA.
|
||||
|
||||
### Common
|
||||
- `DEBUG=1`: Set this variable to any value to enable debug and verbose logs.
|
||||
- You can also do it for a **specific session** by setting `config.debug` field to `true` when starting a session.
|
||||
- `WHATSAPP_API_PORT=3000`: The port number that the HTTP server will listen on. The default value is `3000`.
|
||||
- `WHATSAPP_API_HOSTNAME=localhost`: The hostname for the HTTP server. The default value is `localhost`.
|
||||
|
||||
@@ -38,10 +39,17 @@ The following environment variables can be used to configure the WAHA.
|
||||
response.
|
||||
- `WHATSAPP_START_SESSION=session1,session2`: This variable can be used to start sessions with the specified names right
|
||||
after launching the API. Separate session names with a comma.
|
||||
- Also read more about [Sessions ->]({{< relref "/docs/how-to/sessions" >}})
|
||||
- Also read more about [Session Storages on the dedicated page ->]({{< relref "/docs/how-to/storages#sessions" >}})
|
||||
|
||||
### Swagger
|
||||
- `WHATSAPP_SWAGGER_CONFIG_ADVANCED=true` - enables advanced configuration options for Swagger documentation - you can customize host, port and base URL for the requests.
|
||||
Disabled by default.
|
||||
- `WHATSAPP_SWAGGER_ENABLED=false` - disables Swagger documentation. Enabled by default. Available in **WAHA Plus** only.
|
||||
- `WHATSAPP_SWAGGER_USERNAME=admin` and `WHATSAPP_SWAGGER_PASSWORD=admin` - these variables can be used to protect the Swagger panel
|
||||
with `admin / admin` credentials. This does not affect API access. Available in **WAHA Plus** only.
|
||||
|
||||
Read more about Swagger configuration on [**Swagger page** ->]({{< relref "/docs/how-to/swagger" >}}).
|
||||
|
||||
### Proxy
|
||||
#### Global proxy configuration
|
||||
@@ -61,24 +69,59 @@ Read more about it on [**Session page** ->]({{< relref "/docs/how-to/sessions#co
|
||||
Keep in mind that session's proxy configuration takes precedence over proxy configuration set by environment variables!
|
||||
|
||||
|
||||
### Security 
|
||||
### Security
|
||||
<b>Security is available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
- `WHATSAPP_API_KEY=mysecret`: If you set this variable, you must include the `X-Api-Key: mysecret` header in all
|
||||
requests to the API. This will protect the API with a secret code.
|
||||
- `WHATSAPP_SWAGGER_USERNAME=admin` and `WHATSAPP_SWAGGER_PASSWORD=admin`: These variables can be used to protect the
|
||||
Swagger panel with `admin / admin` credentials. This does not affect API access.
|
||||
|
||||
Read more about security settings for Swagger and API on [**Security page** ->]({{< relref "/docs/how-to/security" >}}).
|
||||
|
||||
### Files 
|
||||
### Files
|
||||
<b>Files configuration is available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
The following environment variables can be used to configure the file storage options for the WAHA:
|
||||
|
||||
- `WHATSAPP_FILES_MIMETYPES`: This variable can be used to download only specific mimetypes from messages. By default,
|
||||
all files are downloaded. The mimetypes must be separated by a comma, without spaces. For
|
||||
example: `audio,image/png,image/gif`. To choose a specific type, use a prefix (like `audio,image`).
|
||||
- `WHATSAPP_FILES_MIMETYPES`: This variable can be used to download only specific mimetypes from messages.
|
||||
By default, all files are downloaded. The mimetypes must be separated by a comma, without spaces.
|
||||
For example: `audio,image/png,image/gif`. To choose a specific type, use a prefix (like `audio,image`). See usage below.
|
||||
- `WHATSAPP_DOWNLOAD_MEDIA=true` - this variable can be used to **completely** disable downloading media files. By default, all files are downloaded.
|
||||
Set this variable to `WHATSAPP_DOWNLOAD_MEDIA=false` to disable downloading media files.
|
||||
- Under the hood, it sets `WHATSAPP_FILES_MIMETYPES=mimetype/ignore-all-media` to ignore all media files.
|
||||
- `WHATSAPP_FILES_LIFETIME`: This variable can be used to set the time (in seconds) after which files will be removed to
|
||||
free up space. The default value is `180`.
|
||||
- Set this variable to `0` to disable the file lifetime.
|
||||
- `WHATSAPP_FILES_FOLDER`: This variable can be used to set the folder where files from chats (images, voice messages)
|
||||
will be stored. The default value is `/tmp/whatsapp-files`.
|
||||
- The folder must be mounted to the host machine to keep the files between container restarts. [ Read more about how to persist files ->]({{< relref "/docs/how-to/storages#media" >}})
|
||||
- Also read more about [Media Storages on the dedicated page ->]({{< relref "/docs/how-to/storages#media" >}})
|
||||
|
||||
💡 Even if WAHA doesn't process the message media because of `WHATSAPP_FILES_MIMETYPES` or `WHATSAPP_DOWNLOAD_MEDIA`
|
||||
you'll get a webhook event with `hasMedia: True` field, but with no `media.url`.
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"hasMedia": true,
|
||||
"media": {
|
||||
"url": null,
|
||||
"mimetype": "video/mp4",
|
||||
"filename": null
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Health Check
|
||||
<b>Health check is available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
The following environment variables can be used to configure the [Health Check ->]({{< relref "/docs/how-to/other" >}}):
|
||||
- `WHATSAPP_HEALTH_MEDIA_FILES_THRESHOLD_MB` - the threshold in MB for the media files storage. The default value is `100`.
|
||||
- `WHATSAPP_HEALTH_SESSIONS_FILES_THRESHOLD_MB` - the threshold in MB for the sessions files storage. The default value is `100`.
|
||||
- `WHATSAPP_HEALTH_MONGODB_TIMEOUT` - the timeout in milliseconds for the MongoDB health check. The default value is `5000`.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -138,6 +181,13 @@ comma-separated list of mimetypes:
|
||||
WHATSAPP_FILES_MIMETYPES=audio,image/png,image/gif
|
||||
```
|
||||
|
||||
#### Disable Downloading Media Files
|
||||
To disable downloading media files, set the `WHATSAPP_DOWNLOAD_MEDIA` environment variable to `false`:
|
||||
|
||||
```
|
||||
WHATSAPP_DOWNLOAD_MEDIA=false
|
||||
```
|
||||
|
||||
#### Setting the File Lifetime
|
||||
|
||||
To set the time (in seconds) after which files will be removed to free up space, set the `WHATSAPP_FILES_LIFETIME`
|
||||
|
||||
@@ -13,7 +13,10 @@ Methods for contacts.
|
||||
|
||||
{{< alert icon="👉" text="WhatsApp Web does not support adding contacts, so the API doesn't support it too." />}}
|
||||
|
||||
## Get all contacts
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Get all contacts
|
||||
|
||||
Get your contacts - `GET /api/contacts/all`
|
||||
|
||||
@@ -34,7 +37,7 @@ Get your contacts - `GET /api/contacts/all`
|
||||
]
|
||||
```
|
||||
|
||||
## Get contact
|
||||
### Get contact
|
||||
|
||||
Get contact
|
||||
|
||||
@@ -56,19 +59,32 @@ Get contact
|
||||
}
|
||||
```
|
||||
|
||||
## Check phone number exists
|
||||
### Check phone number exists
|
||||
|
||||
If you want to check if phone number is registered in WhatsApp (even if the number is not in your contact list) - use
|
||||
this endpoint for that.
|
||||
- `GET /api/contacts/check-exists?phone=11231231231&session=default`
|
||||
```bash
|
||||
GET /api/contacts/check-exists?phone=11231231231&session=default
|
||||
```
|
||||
It returns `numberExists` field with `true` or `false` value and `chatId` field with chat ID of the number (if exists).
|
||||
|
||||
```json
|
||||
{
|
||||
"numberExists": true
|
||||
"numberExists": true,
|
||||
"chatId": "123123123@c.us"
|
||||
}
|
||||
```
|
||||
**Note for Brazilian Phone Numbers**
|
||||
|
||||
## Get "about" contact
|
||||
You should use the `GET /api/contacts/check-exists` endpoint **before sending a message to a new phone number**
|
||||
to get the correct chatId because of the additional 9-digit number added after 2012.
|
||||
|
||||
Read more about
|
||||
[error sending text to half of Brazilian numbers (every number registered before 2012) ->](https://github.com/devlikeapro/whatsapp-http-api/issues/238)
|
||||
|
||||
It's fine to send the response to `chatId` for incoming messages, though - the payload already has the correct `chatId`.
|
||||
|
||||
### Get "about" contact
|
||||
|
||||
- `GET /api/contacts/about?contactId=11231231231&session=default`
|
||||
|
||||
@@ -78,7 +94,7 @@ this endpoint for that.
|
||||
}
|
||||
```
|
||||
|
||||
## Get contact profile picture
|
||||
### Get contact profile picture
|
||||
|
||||
- `GET /api/contacts/profile-picture?contactId=11231231231&session=default`
|
||||
|
||||
@@ -88,7 +104,7 @@ this endpoint for that.
|
||||
}
|
||||
```
|
||||
|
||||
## Block (unblock) contact
|
||||
### Block (unblock) contact
|
||||
- To block contact - `POST /api/contacts/block`
|
||||
- To unblock contact - `POST /api/contacts/unblock`
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 899
|
||||
weight: 898
|
||||
---
|
||||
|
||||
This page provides useful information to assist you in deploying the project.
|
||||
|
||||
@@ -9,7 +9,9 @@ images: [ ]
|
||||
weight: 800
|
||||
---
|
||||
|
||||
Under the hood **WAHA** allows you to use two different engines. You can control what you want to run by settings
|
||||
## Engines
|
||||
|
||||
Under the hood **WAHA** allows you to use different engines. You can control what you want to run by settings
|
||||
`WHATSAPP_DEFAULT_ENGINE` environment variables.
|
||||
|
||||
```bash
|
||||
@@ -18,35 +20,209 @@ docker run -it -e "WHATSAPP_DEFAULT_ENGINE=WEBJS" devlikeapro/whatsapp-http-api
|
||||
|
||||
If you have any problems with one engine - try another!
|
||||
|
||||
{{< alert icon="👉" text="API responses and webhook payloads may differ significantly! We do our best to keep requests body stable between engines." />}}
|
||||
{{< alert icon="👉" text="API responses and webhook payloads may differ significantly, test everything before changing the engine" />}}
|
||||
|
||||
All engines are available in Core version 
|
||||
All engines are available in both
|
||||
Core  and
|
||||
[Plus  versions]({{< relref "/docs/how-to/plus-version" >}}).
|
||||
|
||||
## WEBJS
|
||||
### WEBJS
|
||||
|
||||
- `WHATSAPP_DEFAULT_ENGINE=WEBJS`
|
||||
- [https://github.com/pedroslopez/whatsapp-web.js](https://github.com/pedroslopez/whatsapp-web.js)
|
||||
|
||||
A WhatsApp API client that connects through the WhatsApp Web browser app.
|
||||
It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.
|
||||
|
||||
**WAHA** uses **WhatsApp WebJS** engine by default.
|
||||
|
||||
- `WHATSAPP_DEFAULT_ENGINE=WEBJS`
|
||||
- https://github.com/pedroslopez/whatsapp-web.js
|
||||
### NOWEB
|
||||
|
||||
## NOWEB
|
||||
- `WHATSAPP_DEFAULT_ENGINE=NOWEB`
|
||||
- [https://github.com/WhiskeySockets/Baileys](https://github.com/WhiskeySockets/Baileys)
|
||||
|
||||
**NOWEB** engine does not require a browser to work with WhatsApp Web, it does so directly using a WebSocket.
|
||||
**NOWEB** engine **does not require a browser** to work with WhatsApp Web, it does so directly using a WebSocket.
|
||||
Not running Chromium saves you CPU and Memory, so you can run more instances on a single server!
|
||||
|
||||
️Working with the engine requires more attention, because it's easy to be blocked with it!
|
||||
|
||||
⚠ Read the article before using **NOWEB** engine [How to avoid blocking ->]({{< relref "/docs/overview/how-to-avoid-blocking" >}}).
|
||||
⚠ Read the article before using **NOWEB** engine
|
||||
|
||||
- `WHATSAPP_DEFAULT_ENGINE=NOWEB`
|
||||
- https://github.com/WhiskeySockets/Baileys
|
||||
Quotes from the users:
|
||||
> The server has **2 CPU and 8GB** of memory. Today we have **85 sessions** in this instance.
|
||||
|
||||
## VENOM
|
||||
> **400** sessions with **4CPU and 32RAM**. It's working fine.
|
||||
|
||||
It's a high-performance system developed with JavaScript to create a bot for WhatsApp
|
||||
[How to avoid blocking ->]({{< relref " /docs/overview/how-to-avoid-blocking" >}}).
|
||||
|
||||
### VENOM
|
||||
|
||||
- `WHATSAPP_DEFAULT_ENGINE=VENOM`
|
||||
- https://github.com/orkestral/venom
|
||||
- [https://github.com/orkestral/venom](https://github.com/orkestral/venom)
|
||||
|
||||
It's a high-performance system developed with JavaScript to create a bot for WhatsApp.
|
||||
It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.
|
||||
|
||||
## Docker images
|
||||
WAHA provides few docker images with different setup.
|
||||
|
||||
| Image | CPU | Browser |
|
||||
|---------------------------------------------------------|-----|-------------------------|
|
||||
| [WAHA Plus]({{< relref "/docs/how-to/plus-version" >}}) | | |
|
||||
| `devlikeapro/whatsapp-http-api-plus:latest` | x86 | Chromium |
|
||||
| `devlikeapro/whatsapp-http-api-plus:chrome` | x86 | Chrome (supports video) |
|
||||
| `devlikeapro/whatsapp-http-api-plus:noweb` | x86 | None |
|
||||
| `devlikeapro/whatsapp-http-api-plus:arm` | ARM | Chromium |
|
||||
| `devlikeapro/whatsapp-http-api-plus:noweb-arm` | ARM | None |
|
||||
| **WAHA Core** | | |
|
||||
| `devlikeapro/whatsapp-http-api:latest` | x86 | Chromium |
|
||||
| `devlikeapro/whatsapp-http-api:chrome` | x86 | Chrome |
|
||||
| `devlikeapro/whatsapp-http-api:noweb` | x86 | None |
|
||||
| `devlikeapro/whatsapp-http-api:arm` | ARM | Chromium |
|
||||
| `devlikeapro/whatsapp-http-api:noweb-arm` | ARM | None |
|
||||
|
||||
Browsers:
|
||||
- **Chromium** - is the default browser for **WAHA**. It's a good choice for most cases.
|
||||
- **Chrome** - is a good choice if you need to receive videos in Plus version.
|
||||
- **None** - is a good choice if you want to use **NOWEB** engine.
|
||||
|
||||
CPU:
|
||||
- **x86** - is a good choice for most cases.
|
||||
- **ARM** - is a good choice if you're using ARM processors (like Apple Silicon, Apple M1, etc.)
|
||||
{{< alert icon="💡" text="Chrome version is not available in ARM" />}}
|
||||
|
||||
## Features
|
||||
|
||||
Some engines may not support certain features.
|
||||
Here, you will find a list of supported endpoints and webhooks per engine.
|
||||
|
||||
| Symbol | Meaning |
|
||||
|:------------------------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| ✔️ | The engines supports the feature. |
|
||||
| ➖ | The engine does **not** support this feature. <br/>Please search for the issue about the endpoint in [the project's issue](https://github.com/devlikeapro/whatsapp-http-api/issues) and upvote it by using the "👍" reaction on the issue's description. This will help us determine the level of interest in the feature. <br/>If you are unable to find the issue, please create a new one. |
|
||||
|  | The feature available in [WAHA Plus]({{< relref "/docs/how-to/plus-version" >}}). |
|
||||
|
||||
If you don't specify `WHATSAPP_DEFAULT_ENGINE` environment variable - look at **WEBJS** engine,
|
||||
it's the engine WAHA runs by default.
|
||||
|
||||
### Protocols
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|--------------------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| Run a browser (chromium\chrome) to communicate with WhatsApp | ✔️ | ➖ | ✔️ |
|
||||
| Communicate with WhatsApp via websocket (no browser) | ➖ | ✔️ | ➖ |
|
||||
|
||||
### Endpoints
|
||||
|
||||
If you find any inconsistency with actual endpoints -
|
||||
please [create an issue](https://github.com/devlikeapro/whatsapp-http-api/issues/new?title=Error+in+engine+features )
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|-------------------------------------------------------------------|:-----:|:-------------------------------------------------------------------------:|:-----:|
|
||||
| **Session** | | | |
|
||||
| `POST /api/sessions/start` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sessions/stop` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sessions/logout` | ✔️ | ✔️ | ✔️ |
|
||||
| `GET /api/sessions/` | ✔️ | ✔️ | ✔️ |
|
||||
| `GET /api/sessions/{session}/me` | ✔️ | ✔️ | ➖ |
|
||||
| **Authentication** | | | |
|
||||
| `POST /api/{session}/auth/qr` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/{session}/auth/request-code` | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/auth/authorize-code` | ➖ | ➖️<br>[#113](https://github.com/devlikeapro/whatsapp-http-api/issues/113) | ➖ |
|
||||
| **Screenshot** | | | |
|
||||
| `POST /api/screenshot` | ✔️ | ➖ | ✔️ |
|
||||
|
||||
| **Chatting** | WEBJS | NOWEB | VENOM |
|
||||
|-------------------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| `GET /api/checkNumberStatus` | ✔️ | ✔️ | ✔️ |
|
||||
| `GET /api/sendContactVcard` | ➖ | ✔️ | ➖ |
|
||||
| `GET /api/sendText` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendText` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/reply` | ✔️ | ✔️ | ✔️ |
|
||||
| `PUT /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️ | ➖ |
|
||||
| `DELETE /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/sendPoll` | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/sendLocation` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendLinkPreview` | ➖ | ✔️ | ✔️ |
|
||||
| `POST /api/sendImage`  | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendFile`  | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendVoice`  | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendVideo`  | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/sendSeen` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/startTyping` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/stopTyping` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/reaction` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/star` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/messages` | ✔️ | ➖ | ✔️ |
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|-------------------------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| **Status** | | | |
|
||||
| `POST /api/{session}/status/text` | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/status/image`  | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/status/voice`  | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/status/video`  | ➖ | ✔️ | ➖ |
|
||||
| **Chats** | | | |
|
||||
| `GET /api/{session}/chats` | ✔️ | ➖ | ➖ |
|
||||
| `DELETE /api/{session}/chats/{chatId}` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/{session}/chats/{chatId}/messages` | ✔️ | ➖ | ✔️ |
|
||||
| `DELETE /api/{session}/chats/{chatId}/messages` | ✔️ | ➖ | ➖ |
|
||||
| `PUT /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️ | ➖ |
|
||||
| `DELETE /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️ | ➖ |
|
||||
| **Contacts** | | | |
|
||||
| `GET /api/contacts` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/contacts/all` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/contacts/check-exists` | ✔️ | ✔️ | ✔️ |
|
||||
| `GET /api/contacts/about` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/contacts/profile-picture` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/contacts/block` | ✔️ | ➖ | ➖ |
|
||||
| `POST /api/contacts/unblock` | ✔️ | ➖ | ➖ |
|
||||
|
||||
| **Groups** | WEBJS | NOWEB | VENOM |
|
||||
|------------------------------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| `POST /api/{session}/groups` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/groups` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}` | ✔️ | ✔️ | ➖ |
|
||||
| `DELETE /api/{session}/groups/{id}` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}/settings/security/info-admin-only` | ✔️ | ➖ | ➖ |
|
||||
| `PUT /api/{session}/groups/{id}/settings/security/info-admin-only` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}/settings/security/messages-admin-only` | ✔️ | ➖ | ➖ |
|
||||
| `PUT /api/{session}/groups/{id}/settings/security/messages-admin-only` | ✔️ | ➖ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/leave` | ✔️ | ✔️ | ➖ |
|
||||
| `PUT /api/{session}/groups/{id}/description` | ✔️ | ✔️ | ➖ |
|
||||
| `PUT /api/{session}/groups/{id}/subject` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}/invite-code` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/invite-code/revoke` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}/participants` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/participants/add` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/participants/remove` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/admin/promote` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/admin/demote` | ✔️ | ✔️ | ➖ |
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|---------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| **Presence** | | | |
|
||||
| `POST /api/{session}/presence` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/presence` | ➖ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/presence/{chatId}` | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/presence/{chatId}/subscribe` | ➖ | ✔️ | ➖ |
|
||||
| **Other** | | | |
|
||||
| `GET /api/version` | ➖ | ✔️ | ➖ |
|
||||
| `GET /health`  | ✔️ | ✔️ | ✔️ |
|
||||
|
||||
### Webhooks
|
||||
|
||||
| **Webhooks** | WEBJS | NOWEB | VENOM |
|
||||
|-----------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| `message` | ✔️ | ✔️ | ✔️ |
|
||||
| `message` with files  | ✔️ | ✔️ | ✔️ |
|
||||
| `message.reaction` | ✔️ | ✔️ | ➖ |
|
||||
| `message.any` | ✔️ | ✔️ | ✔️ |
|
||||
| `message.ack` | ✔️ | ✔️ | ✔️ |
|
||||
| `message.revoked` | ✔️ | ➖ | ➖ |
|
||||
| `state.change` | ✔️ | ✔️ | ✔️ |
|
||||
| `group.join` | ✔️ | ✔️ | ✔️ |
|
||||
| `group.leave` | ✔️ | ➖ | ➖ |
|
||||
| `presence.update` | ➖ | ✔️ | ➖ |
|
||||
| `poll.vote` | ➖ | ✔️ | ➖ |
|
||||
| `poll.vote.failed` | ➖ | ✔️ | ➖ |
|
||||
@@ -9,7 +9,10 @@ images: []
|
||||
weight: 140
|
||||
---
|
||||
|
||||
Methods for groups. Please look at swagger for details.
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
Endpoints for groups. Please look at swagger for details.
|
||||
|
||||
- `{session}` - use the session name for Whatsapp instance that you created with `POST /api/session/start` endpoint
|
||||
- `{groupId}` - group id in format `123123123123@g.us`. You can get the id in a few ways:
|
||||
@@ -17,7 +20,7 @@ Methods for groups. Please look at swagger for details.
|
||||
- By getting all groups (see below).
|
||||
- By creating a new group and saving the id.
|
||||
|
||||
## Create a new group
|
||||
### Create a new group
|
||||
|
||||
`POST /api/{session}/groups`
|
||||
|
||||
@@ -34,23 +37,23 @@ Request:
|
||||
}
|
||||
```
|
||||
|
||||
## Get all groups
|
||||
### Get all groups
|
||||
|
||||
`GET /api/{session}/groups`
|
||||
|
||||
## Get the group
|
||||
### Get the group
|
||||
|
||||
`GET /api/{session}/groups/{groupId}`
|
||||
|
||||
## Delete the group
|
||||
### Delete the group
|
||||
|
||||
`DELETE /api/{session}/groups/{groupId}`
|
||||
|
||||
## Leave the group
|
||||
### Leave the group
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/leave`
|
||||
|
||||
## Set group subject
|
||||
### Set group subject
|
||||
|
||||
Updates the group subject.
|
||||
|
||||
@@ -67,7 +70,7 @@ Request:
|
||||
}
|
||||
```
|
||||
|
||||
## Set group description
|
||||
### Set group description
|
||||
|
||||
Updates the group description.
|
||||
|
||||
@@ -84,24 +87,54 @@ Request:
|
||||
}
|
||||
```
|
||||
|
||||
## Settings
|
||||
### Security for group info
|
||||
### Security - update group info
|
||||
Updates the group settings to only allow admins to edit group info (title, description, photo).
|
||||
|
||||
`PUT /api/{session}/groups/{groupId}/settings/security/info-admin-only`
|
||||
```json
|
||||
{
|
||||
"adminsOnly": true
|
||||
}
|
||||
```
|
||||
|
||||
The request doesn't require any request's body and
|
||||
**can't be used to disable the security setting (allow ANY to edit group info)**.
|
||||
If you wish to have that ability - please [create an issue](https://github.com/devlikeapro/whatsapp-http-api/issues)
|
||||
Get the group settings to only allow admins to edit group info (title, description, photo).
|
||||
|
||||
`GET /api/{session}/groups/{groupId}/settings/security/info-admin-only`
|
||||
```json
|
||||
{
|
||||
"adminsOnly": true
|
||||
}
|
||||
```
|
||||
|
||||
Returns `true` if the setting was properly updated. This can return false if the user does not have the necessary permissions.
|
||||
|
||||
|
||||
## Participants
|
||||
### Security - who can send messages
|
||||
Updates the group settings to only allow admins to send messages.
|
||||
|
||||
### Get participants
|
||||
`PUT /api/{session}/groups/{groupId}/settings/security/messages-admin-only`
|
||||
```json
|
||||
{
|
||||
"adminsOnly": true
|
||||
}
|
||||
```
|
||||
Returns `true` if the setting was properly updated. This can return false if the user does not have the necessary permissions.
|
||||
|
||||
Get the group settings to only allow admins to send messages.
|
||||
|
||||
`GET /api/{session}/groups/{groupId}/settings/security/messages-admin-only`
|
||||
```json
|
||||
{
|
||||
"adminsOnly": true
|
||||
}
|
||||
```
|
||||
|
||||
### Participants
|
||||
|
||||
#### Get participants
|
||||
|
||||
`GET /api/{session}/groups/{groupId}/participants`
|
||||
|
||||
### Add participants
|
||||
#### Add participants
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/participants/add`
|
||||
|
||||
@@ -115,7 +148,7 @@ If you wish to have that ability - please [create an issue](https://github.com/d
|
||||
}
|
||||
```
|
||||
|
||||
### Remove participants
|
||||
#### Remove participants
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/participants/remove`
|
||||
|
||||
@@ -129,9 +162,9 @@ If you wish to have that ability - please [create an issue](https://github.com/d
|
||||
}
|
||||
```
|
||||
|
||||
## Admin
|
||||
### Admin
|
||||
|
||||
### Promote to admin
|
||||
#### Promote to admin
|
||||
|
||||
Promote participants to admin users.
|
||||
|
||||
@@ -147,7 +180,7 @@ Promote participants to admin users.
|
||||
}
|
||||
```
|
||||
|
||||
### Demote to regular users
|
||||
#### Demote to regular users
|
||||
|
||||
Demote participants by to regular users.
|
||||
|
||||
@@ -163,17 +196,45 @@ Demote participants by to regular users.
|
||||
}
|
||||
```
|
||||
|
||||
## Invite code
|
||||
### Invite code
|
||||
|
||||
### Get invite code
|
||||
#### Get invite code
|
||||
|
||||
`GET /api/{session}/groups/{groupId}/invite-code`
|
||||
|
||||
Then you can put it in the url `https://chat.whatsapp.com/{inviteCode}` and send it to contacts.
|
||||
|
||||
### Revoke invite code
|
||||
#### Revoke invite code
|
||||
|
||||
Invalidates the current group invite code and generates a new one.
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/invite-code/revoke`
|
||||
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### group.join
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "group.join",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### group.leave
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "group.left",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,115 @@
|
||||
---
|
||||
title : "Install"
|
||||
description: "How to install and update WAHA"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 109
|
||||
---
|
||||
|
||||
On the page you'll find answers on how to install WAHA.
|
||||
|
||||
If you wish to read a quick start guide which show you how to send you first message via HTTP API
|
||||
please go to [**Quick Start ->**]({{< relref "/docs/overview/quick-start" >}}).
|
||||
|
||||
WAHA is distributed in two versions, that have a similar installation instructions.
|
||||
- WAHA Core  - the basic version that meet almost 80% people's needs. 100% free and [open source ->](https://github.com/devlikeapro/whatsapp-http-api).
|
||||
- WAHA Plus  - the version with advanced messages, security, and reliability features. Donations, no license expiration, quick updates, read more about [Plus Version →]({{< relref "plus-version" >}})
|
||||
|
||||
## Requirements
|
||||
|
||||
Only thing that you must have - installed docker. Please follow the original
|
||||
instruction <a href="https://docs.docker.com/get-docker/" target="_blank" rel="noopener">how to install docker -></a>.
|
||||
|
||||
{{< details "Why Docker?" >}}
|
||||
Docker makes it easy to ship all-in-one solution with the runtime and dependencies. You don't have to worry about
|
||||
language-specific libraries or chrome installation.
|
||||
|
||||
Also, Docker makes installation and update processes so simple, just one command!
|
||||
{{< /details >}}
|
||||
|
||||
## WAHA Core
|
||||
Download the image:
|
||||
```bash
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
Run the container:
|
||||
```bash
|
||||
docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
Open API documentation [http://localhost:3000](http://localhost:3000).
|
||||
|
||||
## WAHA Plus
|
||||
Before installing WAHA Plus version you need to get a key, `{KEY}` in below commands, in format `dckr_pat_1111`
|
||||
|
||||
We distribute the key via two platforms (Boosty and Patreon) and you'll find the active key **in the latest post**.
|
||||
Keep in mind that we publish new key every month, so you must get the latest active key in order to download
|
||||
the latest image.
|
||||
|
||||
Read more about [**Plus Version →**]({{< relref "plus-version" >}})
|
||||
|
||||
{{< alert icon="👉" text="Subscribe as **PRO** level and get your personal key which won't expire every month while you're supporting the project" />}}
|
||||
|
||||
Download the image:
|
||||
```bash
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
|
||||
Run the container:
|
||||
```bash
|
||||
docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
Open API documentation [http://localhost:3000](http://localhost:3000).
|
||||
|
||||
## ARM
|
||||
If you’re using **ARM** processor (like Apple Silicon, Apple M1, etc.) - add `:arm` tag at the end of the image name in the above commands.
|
||||
- **WAHA Core** - `devlikeapro/whatsapp-http-api:arm`
|
||||
- **WAHA Plus** - `devlikeapro/whatsapp-http-api-plus:arm`
|
||||
|
||||
You can also rename the image after you downloaded it with `docker tag` command,
|
||||
so you can use the same image names in commands:
|
||||
```bash
|
||||
# Rename WAHA Core ARM
|
||||
docker tag devlikeapro/whatsapp-http-api:arm devlikeapro/whatsapp-http-api
|
||||
|
||||
# Rename WAHA Plus ARM
|
||||
docker tag devlikeapro/whatsapp-http-api-plus:arm devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
|
||||
## Update WAHA
|
||||
{{< alert icon="💡" text="Please test all new versions in the development environment before updating production!" />}}
|
||||
|
||||
The commands are the same as for downloading, expected you need to restart **all working containers** after you download new image.
|
||||
|
||||
**WAHA Core** - download new image
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
|
||||
# Restart all containers
|
||||
docker stop whatsapp-http-api
|
||||
docker rm whatsapp-http-api
|
||||
docker run -it --rm -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
**WAHA Plus** - download new image (please use **the latest key** from Boosty or Patreon)
|
||||
```bash
|
||||
# Download the image
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
docker stop whatsapp-http-api
|
||||
|
||||
# Restart all containers
|
||||
docker stop whatsapp-http-api
|
||||
docker rm whatsapp-http-api
|
||||
docker run -it --rm -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
```
|
||||
@@ -0,0 +1,192 @@
|
||||
---
|
||||
title: "Other"
|
||||
description: "Other features and API"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 802
|
||||
---
|
||||
|
||||
This page provides useful information about other features and API that are not covered in the other sections.
|
||||
|
||||
## Health Check
|
||||
<b>Health check is available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
The health check endpoint is used to determine the health of the service.
|
||||
|
||||
```
|
||||
GET /health
|
||||
```
|
||||
|
||||
It returns a **200 OK** status code if the service is healthy.
|
||||
|
||||
The response format:
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"info": {
|
||||
"metric1": {
|
||||
"field": "value"
|
||||
},
|
||||
"metric2": {
|
||||
"field": "value"
|
||||
}
|
||||
},
|
||||
"error": {},
|
||||
"details": {}
|
||||
}
|
||||
```
|
||||
|
||||
Where:
|
||||
- `status`: `'error' | 'ok' | 'shutting_down'` - If any health indicator failed the status will be `'error'`. If the app is shutting down but still accepting HTTP requests, the health check will have the `'shutting_down'` status.
|
||||
- `info`: Object containing information of each health indicator which is of status `'up'`, or in other words "healthy".
|
||||
- `error`: Object containing information of each health indicator which is of status `'down'`, or in other words "unhealthy".
|
||||
- `details`: Object containing detailed information of each health indicator.
|
||||
|
||||
### Health Check Indicators
|
||||
Few things we check in the health check:
|
||||
- Media files storage space - `mediaFiles.space`
|
||||
- Sessions files storage space - `sessionsFiles.space`
|
||||
- MongoDB connection - `mongodb`
|
||||
|
||||
### Configuration
|
||||
The following environment variables can be used to configure the health check:
|
||||
- `WHATSAPP_HEALTH_MEDIA_FILES_THRESHOLD_MB` - the threshold in MB for the media files storage. The default value is `100`.
|
||||
- `WHATSAPP_HEALTH_SESSIONS_FILES_THRESHOLD_MB` - the threshold in MB for the sessions files storage. The default value is `100`.
|
||||
- `WHATSAPP_HEALTH_MONGODB_TIMEOUT` - the timeout in milliseconds for the MongoDB health check. The default value is `5000`.
|
||||
|
||||
### Examples
|
||||
**Healthy response** when you use [Local Storage]({{< relref "/docs/how-to/storages#sessions" >}}) for session authentication:
|
||||
|
||||
**200 OK**
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"info": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132979355648,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"sessionsFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/app/.sessions",
|
||||
"diskPath": "/",
|
||||
"free": 132979355648,
|
||||
"threshold": 104857600
|
||||
}
|
||||
},
|
||||
"error": {},
|
||||
"details": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132979355648,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"sessionsFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/app/.sessions",
|
||||
"diskPath": "/",
|
||||
"free": 132979355648,
|
||||
"threshold": 104857600
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Healthy response** when you use [MongoDB Storage]({{< relref "/docs/how-to/storages#sessions" >}}) for session authentication:
|
||||
|
||||
**200 OK**
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"info": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132977496064,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"mongodb": {
|
||||
"status": "up",
|
||||
"message": "Up and running"
|
||||
}
|
||||
},
|
||||
"error": {},
|
||||
"details": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132977496064,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"mongodb": {
|
||||
"status": "up",
|
||||
"message": "Up and running"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Unhealthy response example**
|
||||
|
||||
**503 Service Unavailable**
|
||||
```json
|
||||
{
|
||||
"status": "error",
|
||||
"info": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132976623616,
|
||||
"threshold": 104857600
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
"mongodb": {
|
||||
"status": "down",
|
||||
"error": "Timeout"
|
||||
}
|
||||
},
|
||||
"details": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132976623616,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"mongodb": {
|
||||
"status": "down",
|
||||
"error": "Timeout"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Get version
|
||||
Returns the version of the installed docker image.
|
||||
```
|
||||
GET /api/version
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "2024.2.3",
|
||||
"engine": "NOWEB",
|
||||
"tier": "PLUS",
|
||||
"browser": "/usr/bin/google-chrome-stable"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -17,17 +17,17 @@ weight: 900
|
||||
2. Plus  the version with advanced messages, security, and reliability features.
|
||||
|
||||
You support the project and get **WAHA Plus** on
|
||||
<a href="https://boosty.to/wa-http-api" target="_blank">
|
||||
<b>
|
||||
Boosty ->
|
||||
</b>
|
||||
</a>
|
||||
or
|
||||
<a href="https://patreon.com/wa_http_api" target="_blank">
|
||||
<b>
|
||||
Patreon ->
|
||||
</b>
|
||||
</a>
|
||||
or
|
||||
<a href="https://boosty.to/wa-http-api" target="_blank">
|
||||
<b>
|
||||
Boosty ->
|
||||
</b>
|
||||
</a>
|
||||
.
|
||||
|
||||
### Donations
|
||||
@@ -49,44 +49,48 @@ Treat **WAHA Plus** it as an additional episode, behind-the-scenes videos, our n
|
||||
We donate most of the donations down to the stream to the underlying libraries and tools - JS-community, Node, other libraries authors, personal contributors.
|
||||
By donating to the **WAHA** you donate to the Open Source world!
|
||||
|
||||
### Features
|
||||
|
||||
The Plus additional features are:
|
||||
|
||||
1. [**Send images\files\voices** →]({{< relref "/docs/how-to/send-messages" >}})
|
||||
2. [**Receive images\files\voices** →]({{< relref "/docs/how-to/receive-messages" >}})
|
||||
3. [**Webhook retries** →]({{< relref "/docs/how-to/receive-messages#retries" >}})
|
||||
4. [**Security** →]({{< relref "/docs/how-to/security" >}})
|
||||
5. [**Saving sessions** →]({{< relref "/docs/how-to/sessions" >}})
|
||||
6. [**Support multiple sessions** →]({{< relref "/docs/how-to/sessions" >}})
|
||||
7. **Priority in support** - on both bugs and features
|
||||
|
||||
### Why WAHA?
|
||||
|
||||
What is the difference between **WAHA Plus** and **other SaaS solutions** for WhatsApp HTTP API?
|
||||
|
||||
| | WAHA Plus | Others |
|
||||
|--------------------|:-------------------------------------------------:|----------------------------------------------------------------------------------:|
|
||||
| **Sessions** | ✔️ No limits on **accounts** or **servers**! | ➖ One account for $50/month. |
|
||||
| **Infrastructure** | ✔️ On-Premise - your server, your infrastructure! | ➖ Insecure cloud solution. |
|
||||
| **Security** | ✔️ No data leaks! | ➖ You have to give access to customers' data - phone number, name, your messages. |
|
||||
| **License Term** | ✔️ No license checks! | ➖ One month |
|
||||
| **Message price** | ✔️ All messages are Free! | ➖ Some solutions have a price for messages - $1/100 messages. |
|
||||
| **Expenses** | ✔️ $19 **donation**! | ➖ Monthly payment starts from $50 |
|
||||
|
||||
|
||||
## Get Plus 
|
||||
## Tiers
|
||||
|
||||
The more you support the project - the more you get!
|
||||
|
||||
Here's available tiers for our supporters:
|
||||
### Core
|
||||
|
||||
| Essential product for your needs! | |
|
||||
|----------------------------------------------------------------------------------|----------|
|
||||
| [Send and receive text messages ->]({{< relref "/docs/how-to/send-messages" >}}) | ✔️ |
|
||||
| [Webhooks ->]({{< relref "/docs/how-to/webhooks" >}}) | ✔️ |
|
||||
| No license checks on installed instances | ✔️ |
|
||||
| Messages limit | **∞** |
|
||||
| [Sessions limit ->]({{< relref "/docs/how-to/sessions" >}}) | **1** |
|
||||
| **Donation** | **FREE** |
|
||||
|
||||
### Plus
|
||||
| Optimize your experience with extra perks! | |
|
||||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
|
||||
| All in **Core** | ✔️ |
|
||||
| [Sessions limit ->]({{< relref "/docs/how-to/sessions" >}}) | **∞** |
|
||||
| [Send and receive files ->]({{< relref "/docs/how-to/send-messages" >}}) | ✔️ |
|
||||
| [Built-in Security ->]({{< relref "/docs/how-to/security" >}}) | ✔️ |
|
||||
| [Webhook retries →]({{< relref "/docs/how-to/receive-messages#retries" >}}) | ✔️ |
|
||||
| [MongoDB support ->]({{< relref "/docs/how-to/storages" >}}) | ✔️ |
|
||||
| Access to **WAHA Plus** docker image with a personal key. | ✔️ |
|
||||
| [](https://waha.devlike.pro/docs/how-to/plus-version/#tiers) badge and `patron:PLUS` label on [project's issues, PRs and Discussion](https://github.com/devlikeapro/whatsapp-http-api) to highlight your support to the project! | ✔️ |
|
||||
| Built-in [Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}}) - UI to manage your sessions! | ✔️ |
|
||||
| Access to the **WAHA Plus** **source code** (in a private Github repository). | ➖ |
|
||||
| Membership to the **WAHA Discord server** for receiving personal support, and sharing your experiences with other professionals. | ➖ |
|
||||
| [WAHA Hub]({{< relref "/docs/waha-hub/introduction" >}}) - a single place to manage multiple servers! | ➖ |
|
||||
| **Donation** | **$19** |
|
||||
|
||||
### Pro
|
||||
| Exclusive perks for the PROfessionals! | |
|
||||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
|
||||
| All in **Plus** | ✔️ |
|
||||
| [](https://waha.devlike.pro/docs/how-to/plus-version/#tiers) badge and `patron:PRO` label on [project's issues, PRs and Discussion](https://github.com/devlikeapro/whatsapp-http-api) to highlight your support to the project! | ✔️ |
|
||||
| Access to the **WAHA Plus** **source code** (in a private Github repository). | ✔️ |
|
||||
| Membership to the **WAHA Discord server** for receiving personal support, and sharing your experiences with other professionals. | ✔️ |
|
||||
| [WAHA Hub]({{< relref "/docs/waha-hub/introduction" >}}) - a single place to manage multiple servers! | ✔️ |
|
||||
| **Donation** | **$99** |
|
||||
|
||||
| | Plus | Advanced | Pro |
|
||||
|-------------------------------------------------------------------------------------|---------|:--------:|:-------:|
|
||||
| Access to WAHA Plus  docker image. | ✔️ | ✔️ | ✔️ |
|
||||
| An invitation to a private Github repository so you have the WAHA Plus source code. | ➖️ | ✔️ | ✔️️ |
|
||||
| Access to a Telegram group where we provide support and assistance. | ➖️ | ➖ | ✔️ |
|
||||
| **Donation** | **$19** | **$39** | **$99** |
|
||||
|
||||
For **$19** donation you get:
|
||||
1. **Secret password** for Docker Hub to download Plus image: `devlikeapro/whatsapp-http-api-plus`.
|
||||
@@ -97,27 +101,50 @@ For **$19** donation you get:
|
||||
{{< alert icon="💡" text="If you stay subscribed - the donation amount will never change for you and always be $19 to get monthly updates!" />}}
|
||||
|
||||
|
||||
## Why WAHA?
|
||||
|
||||
What is the difference between **WAHA Plus** and **other SaaS solutions** for WhatsApp HTTP API?
|
||||
|
||||
| WAHA Plus | Others |
|
||||
|:-------------------------------------------------:|----------------------------------------------------------------------------------:|
|
||||
| ✔️ No limits on **accounts** or **servers**! | ➖ One account for $50/month. |
|
||||
| ✔️ On-Premise - your server, your infrastructure! | ➖ Insecure cloud solution. |
|
||||
| ✔️ No data leaks! | ➖ You have to give access to customers' data - phone number, name, your messages. |
|
||||
| ✔️ No license checks! | ➖ One month |
|
||||
| ✔️ All messages are **Free**! | ➖ Some solutions have a price for messages - $1/100 messages. |
|
||||
| ✔️ $19 **donation**! | ➖ Monthly payment starts from $50 |
|
||||
|
||||
{{< alert icon="💡" text="If you stay subscribed - the donation amount will never change for you and always be $19 to get monthly updates!" />}}
|
||||
|
||||
## Get Plus 
|
||||
|
||||
{{< alert icon="💡" text="If you stay subscribed - the donation amount will never change for you and always be $19 to get monthly updates!" />}}
|
||||
|
||||
### Boosty
|
||||
<p align="center">
|
||||
<img src="boosty.svg" alt="Patreon" />
|
||||
<img src="boosty.svg" alt="Patreon" style='width: 40%'/>
|
||||
<br/>
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
Support the project and get WAHA Plus version on
|
||||
<a href="https://boosty.to/wa-http-api" target="_blank">
|
||||
<b>
|
||||
Boosty ->
|
||||
</b>
|
||||
<b>
|
||||
Boosty ->
|
||||
</b>
|
||||
</a>
|
||||
|
||||
Go ahead and get your own WhatsApp HTTP API!
|
||||
|
||||
|
||||
### Patreon
|
||||
|
||||
<p align="center">
|
||||
<img src="patreon.png" alt="Patreon" />
|
||||
<img src="patreon.png" alt="Patreon" style='width: 40%'/>
|
||||
</p>
|
||||
|
||||
{{< alert icon="🙏" text="Please consider using Boosty instead of Patreon due to its lower fees 🙏" />}}
|
||||
|
||||
Support the project and get WAHA Plus version on
|
||||
<a href="https://patreon.com/wa_http_api" target="_blank">
|
||||
<b>
|
||||
@@ -128,10 +155,38 @@ Support the project and get WAHA Plus version on
|
||||
Go ahead and get your own WhatsApp HTTP API!
|
||||
|
||||
|
||||
### Crypto
|
||||
<p align="center">
|
||||
<img src="tether-usdt-logo.svg" alt="Tether Logo" style='width: 40%'/>
|
||||
</p>
|
||||
|
||||
If you wish to donate in crypto - please contact us at [crypto@devlike.pro](mailto:crypto@devlike.pro)
|
||||
with the desired **amount**, **currency** and **network**.
|
||||
|
||||
> e.g. "I want to donate $99 in USDT using TRC20 network."
|
||||
|
||||
|
||||
## Patron Portal
|
||||
<p align="center">
|
||||
<img src="patron-portal.png" alt="Patron Portal" />
|
||||
<br/>
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
After subscribing on Patreon or Boosty, you will get access to the [WAHA Patron Portal ->](https://portal.devlike.pro/)
|
||||
where you will get the password to download the Plus image and manage your perks!
|
||||
|
||||
Read more about Patron Portal in
|
||||
**<a href="https://www.patreon.com/posts/waha-patron-97637416" target="_blank">Patreon -> </a>**
|
||||
or
|
||||
**<a href="https://boosty.to/wa-http-api/posts/8319079f-dac1-4179-b954-fcc559097c76" target="_blank">Boosty -></a>**
|
||||
posts.
|
||||
|
||||
### Install Plus
|
||||
After you get the password, use it to login and download docker image:
|
||||
After you get the password, get your login to Docker Hub in [Patron Portal ->](https://portal.devlike.pro/)
|
||||
and run the commands:
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
|
||||
|
After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 339.43 295.27"><title>tether-usdt-logo</title><path d="M62.15,1.45l-61.89,130a2.52,2.52,0,0,0,.54,2.94L167.95,294.56a2.55,2.55,0,0,0,3.53,0L338.63,134.4a2.52,2.52,0,0,0,.54-2.94l-61.89-130A2.5,2.5,0,0,0,275,0H64.45a2.5,2.5,0,0,0-2.3,1.45h0Z" style="fill:#50af95;fill-rule:evenodd"/><path d="M191.19,144.8v0c-1.2.09-7.4,0.46-21.23,0.46-11,0-18.81-.33-21.55-0.46v0c-42.51-1.87-74.24-9.27-74.24-18.13s31.73-16.25,74.24-18.15v28.91c2.78,0.2,10.74.67,21.74,0.67,13.2,0,19.81-.55,21-0.66v-28.9c42.42,1.89,74.08,9.29,74.08,18.13s-31.65,16.24-74.08,18.12h0Zm0-39.25V79.68h59.2V40.23H89.21V79.68H148.4v25.86c-48.11,2.21-84.29,11.74-84.29,23.16s36.18,20.94,84.29,23.16v82.9h42.78V151.83c48-2.21,84.12-11.73,84.12-23.14s-36.09-20.93-84.12-23.15h0Zm0,0h0Z" style="fill:#fff;fill-rule:evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 874 B |
|
After Width: | Height: | Size: 44 KiB |
@@ -0,0 +1,220 @@
|
||||
---
|
||||
title: "Polls"
|
||||
description: "How to send polls and receive votes"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 126
|
||||
---
|
||||
|
||||
|
||||
Waiting for WEBJS engine to support it, and we'll add it ASAP!
|
||||
|
||||

|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Send poll
|
||||
|
||||
Use the endpoint to send a poll!
|
||||
|
||||
```bash
|
||||
POST /api/sendPoll
|
||||
```
|
||||
|
||||
The request body is pretty simple:
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "123123123@c.us",
|
||||
"poll": {
|
||||
"name": "How are you?",
|
||||
"options": [
|
||||
"Awesome!",
|
||||
"Good!",
|
||||
"Not bad!"
|
||||
],
|
||||
"multipleAnswers": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The response you get back:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "true_321321321@c.us_83ACBAAAAAAAAAAAAAAAAAAAA",
|
||||
"other-fields-here": "value"
|
||||
}
|
||||
```
|
||||
|
||||
You must save the `id` field from the response in your database so that you can identify the poll for which you receive
|
||||
a vote (see webhook events below).
|
||||
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### poll.vote
|
||||
|
||||
With this event, you receive new votes for the poll sent.
|
||||
|
||||
#### Vote from a user in direct messages.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_1111111111@c.us_83ACBE602A05C79B234B54415E95EE8A",
|
||||
"to": "me",
|
||||
"from": "1111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": [
|
||||
"Awesome!"
|
||||
],
|
||||
"timestamp": 1692861427
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_1111111111@c.us_BAE5F2EF5C69001E",
|
||||
"to": "1111111111@c.us",
|
||||
"from": "me",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
#### Do I receive votes only for my polls?
|
||||
|
||||
No, you receive all votes. Keep in mind that you'll get all votes with this event, even from other polls. To identify
|
||||
that it's your poll, look at the `poll.fromMe` field.
|
||||
|
||||
#### How to handle multiple-answer votes
|
||||
|
||||
For `multipleAnswers: true`, you receive the `selectedOptions` with all the selected values at a certain moment. So if a
|
||||
user has chosen 3 options from the poll, you will receive **3** `poll.vote` events:
|
||||
|
||||
1. `selectedOptions: ["First"]`
|
||||
2. `selectedOptions: ["First", "Second"]`
|
||||
3. `selectedOptions: ["First", "Second", "Third"]`
|
||||
|
||||
#### Timestamp
|
||||
|
||||
If a user clicks on the poll multiple times, you will receive multiple `poll.vote` events. This is true for
|
||||
both `multipleAnswers: false` (when a user changes their mind about answers) and `multipleAnswers: true` (when a user
|
||||
selects two or more options) events.
|
||||
|
||||
There is a little chance that you may receive votes in the wrong order (due to the nature of HTTP and Webhooks),
|
||||
like `1-3-2` instead of `1-2-3`. To determine the right order, look at the `timestamp` field. The event with a
|
||||
higher `timestamp` value is more recent.
|
||||
|
||||
👉 It's important to save the `timestamp` for each vote in your database and compare them as numbers, without converting to
|
||||
internal datetime. Right now, the `timestamp` shows the timestamp in seconds, but it may be changed to milliseconds in
|
||||
the future.
|
||||
|
||||
#### Vote from a user in a group
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_3333333333333@g.us_1C18A7EAADD2A8D0324755D241C4238A",
|
||||
"to": "3333333333333@g.us",
|
||||
"from": "1111111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": [
|
||||
"Awesome!"
|
||||
],
|
||||
"timestamp": 1692861427
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_3333333333333@g.us_BAE5304BA1ECF704",
|
||||
"to": "33333333333333@g.us",
|
||||
"from": "222222222@c.us",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
### poll.vote.failed
|
||||
|
||||
There may be cases when WAHA fails to decrypt a vote from the user. In such cases, you will receive
|
||||
a `poll.vote.failed` event on your webhook.
|
||||
|
||||
The payload for `poll.vote.failed` is the same as for `poll.vote`, but with an empty list in `selectedOptions`.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote.failed",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_11111111111@c.us_2E8C4CDA89EDE3BC0BC7F605364B8451",
|
||||
"to": "me",
|
||||
"from": "111111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": [],
|
||||
"timestamp": 1692956972
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_1111111111@c.us_BAE595F4E0A2042C",
|
||||
"to": "111111111@c.us",
|
||||
"from": "me",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
#### How should I handle poll.vote.failed events?
|
||||
|
||||
When you send a poll, save the poll configuration (question and options) in your database with the `id` field from the
|
||||
response you received from `POST /api/sendPoll`.
|
||||
|
||||
Later, when you receive a `poll.vote.failed` event, find the `id` for the poll in the database and repeat the same
|
||||
question to the user, apologizing for the inconvenience.
|
||||
For example, you can say:
|
||||
|
||||
> Sorry, we don't understand your choice 😞
|
||||
>
|
||||
> Please click one more time on the message below 👇
|
||||
|
||||
After the user clicks on the poll again, you will receive a `poll.vote` event with their choice.
|
||||
|
||||

|
||||
|
||||
#### How to test poll.vote.failed events?
|
||||
|
||||
To receive `poll.vote.failed` events, follow these steps:
|
||||
|
||||
1. Start a session and authorize it with a QR code.
|
||||
2. Send a poll to a chat.
|
||||
3. Stop the session (logout is not required).
|
||||
4. Start the session again.
|
||||
5. Vote on the poll.
|
||||
6. You will receive a `poll.vote.failed` event.
|
||||
|
||||
#### Why does the poll.vote.failed event occur and when will it be fixed?
|
||||
|
||||
The issue occurs because WAHA does not have a proper storage system, but polls require proper storage in order to
|
||||
decrypt votes later.
|
||||
|
||||
There will be two fixes for this:
|
||||
|
||||
1. In the short term, a [local file storage](https://github.com/devlikeapro/whatsapp-http-api/issues/188) will be used
|
||||
to save poll keys.
|
||||
2. In the long term, work is being done
|
||||
on [remote storages](https://github.com/devlikeapro/whatsapp-http-api/issues/41).
|
||||
|
||||
Even after these fixes are implemented, it's better to handle `poll.vote.failed` events anyway, so your application is
|
||||
prepared for such cases!
|
||||
|
After Width: | Height: | Size: 50 KiB |
@@ -21,12 +21,14 @@ Possible presence statuses that you can set or get for chats:
|
||||
|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Set presence
|
||||
You can set your global or chat-related presence with `POST /api/{session}/presence` endpoint
|
||||
|
||||
Start typing to a chat (you can use `POST /startTyping` instead)
|
||||
```json
|
||||
```
|
||||
POST /api/{session}/presence
|
||||
{
|
||||
"chatId": "111111111@c.us",
|
||||
"presence": "typing"
|
||||
@@ -34,7 +36,8 @@ Start typing to a chat (you can use `POST /startTyping` instead)
|
||||
```
|
||||
|
||||
Clear "typing" state (you can use `POST /stopTyping` instead)
|
||||
```json
|
||||
```
|
||||
POST /api/{session}/presence
|
||||
{
|
||||
"chatId": "111111111@c.us",
|
||||
"presence": "paused"
|
||||
@@ -42,7 +45,8 @@ Clear "typing" state (you can use `POST /stopTyping` instead)
|
||||
```
|
||||
|
||||
Set global "online", all contacts will see it
|
||||
```json
|
||||
```
|
||||
POST /api/{session}/presence
|
||||
{
|
||||
"presence": "online"
|
||||
}
|
||||
@@ -52,7 +56,8 @@ Set global "online", all contacts will see it
|
||||
to the device.
|
||||
If you would like to receive said notifications - you need to mark a session's presence as `offline`.
|
||||
|
||||
```json
|
||||
```
|
||||
POST /api/{session}/presence
|
||||
{
|
||||
"presence": "offline"
|
||||
}
|
||||
@@ -60,9 +65,6 @@ If you would like to receive said notifications - you need to mark a session's p
|
||||
|
||||
### Get all chats presence
|
||||
|
||||
{{< alert icon="👉" text="Get presence endpoints and webhook is available only in **NOWEB** engine." />}}
|
||||
[Read more about engines to choose right for you ->]({{< relref "/docs/how-to/engines" >}})
|
||||
|
||||
Here's few notes about fields:
|
||||
|
||||
- `chatId` - either contact id (`213213213@c.us`) or group chat id (`1111111111111@g.us`).
|
||||
@@ -129,7 +131,10 @@ You can subscribe to presence information by calling `POST /api/{session}/presen
|
||||
You can get later presence information for the chat with above `GET` endpoints or by listening to `presence.update`
|
||||
webhook.
|
||||
|
||||
## Webhook
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### presence.update
|
||||
|
||||
You can subscribe to `presence.update` webhook event to get the most recent presence information.
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ We consider that you've run docker container and authenticated the session with
|
||||
|
||||
If you haven't yet - please follow the steps from [**Quick Start →**]({{< relref "/docs/overview/quick-start" >}}).
|
||||
|
||||
## Webhooks
|
||||
|
||||
You must use [Webhooks]({{< relref "/docs/how-to/webhooks" >}}) to receive messages from WhatsApp to your application.
|
||||
|
||||
Start a new session with configured `message` event in webhooks - call `POST /api/sessions/start` with the payload:
|
||||
@@ -36,7 +34,9 @@ Start a new session with configured `message` event in webhooks - call `POST /ap
|
||||
After that WAHA'll send events (see below) about new messages to an endpoint you provided.
|
||||
|
||||
|
||||
## Events
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
Here's examples of message-related events.
|
||||
Read [Webhooks ->]({{< relref "/docs/how-to/webhooks" >}}) to find how to set them up.
|
||||
|
||||
@@ -115,6 +115,43 @@ Fired on all message creations, including your own. The payload is the same as f
|
||||
}
|
||||
```
|
||||
|
||||
### message.reaction
|
||||
Receive events when a message is reacted to by a user (or **yourself** reacting to a message).
|
||||
- `payload.reaction.text` - emoji that was used to react to the message. It'll be an empty string if the reaction was removed.
|
||||
- `payload.reaction.messageId` - id of the message that was reacted to.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.reaction",
|
||||
"session": "default",
|
||||
"me": {
|
||||
"id": "79222222222@c.us",
|
||||
"pushName": "WAHA"
|
||||
},
|
||||
"payload": {
|
||||
"id": "false_79111111@c.us_11111111111111111111111111111111",
|
||||
"from": "79111111@c.us",
|
||||
"fromMe": false,
|
||||
"participant": "79111111@c.us",
|
||||
"to": "79111111@c.us",
|
||||
"timestamp": 1710481111.853,
|
||||
"reaction": {
|
||||
"text": "🙏",
|
||||
"messageId": "true_79111111@c.us_11111111111111111111111111111111"
|
||||
}
|
||||
},
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"version": "2024.3.3",
|
||||
"engine": "WEBJS",
|
||||
"tier": "PLUS",
|
||||
"browser": "/usr/bin/google-chrome-stable"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{{< alert icon="👉" text="NOWEB engine note - reactions were sent in 'message' and 'message.any' events, not it's available only in 'message.reaction'!" />}}
|
||||
|
||||
### message.ack
|
||||
Receive events when server or recipient gets the message, read or played it.
|
||||
|
||||
@@ -128,12 +165,36 @@ Receive events when server or recipient gets the message, read or played it.
|
||||
}
|
||||
```
|
||||
|
||||
### message.revoked
|
||||
|
||||
[See details on Webhooks page ->]({{< relref "webhooks#messageack" >}}).
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.ack",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"before": {
|
||||
"id": "some-id-here",
|
||||
"timestamp": "some-timestamp-here",
|
||||
"body": "Hi there!"
|
||||
},
|
||||
"after": {
|
||||
"id": "some-id-here",
|
||||
"timestamp": "some-timestamp-here",
|
||||
"body": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Files 
|
||||
|
||||
When people send you files - images, voice messages, and documents - WAHA saves it in the file storage.
|
||||
In your application you must download it and use it as you want to. You can find the URL in `mediaUrl` field
|
||||
When people send you media - images, voice messages, and documents - WAHA saves it in the file storage.
|
||||
In your application you must download it and use it as you want to. You can find the URL in `media.url` field.
|
||||
|
||||
For example, you can get the webhook like this with `mediaUrl` value (we've skipped other fields):
|
||||
For example, you can get the webhook like this with `media` value (we've skipped other fields):
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -143,12 +204,35 @@ For example, you can get the webhook like this with `mediaUrl` value (we've skip
|
||||
"id": "true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"timestamp": 1667561485,
|
||||
"from": "11111111111@c.us",
|
||||
"mediaUrl": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.jpg"
|
||||
"hasMedia": true,
|
||||
"media": {
|
||||
"url": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.jpg",
|
||||
"mimetype": "image/jpeg",
|
||||
"filename": null
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Then you can use the link to download the file `http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.jpg`.
|
||||
|
||||
For documents (file attachments) there's also `filename` field with the original file name.
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"id": "true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"timestamp": 1667561485,
|
||||
"from": "11111111111@c.us",
|
||||
"media": {
|
||||
"url": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.pdf",
|
||||
"filename": "some-file.pdf",
|
||||
"mimetype": "application/pdf"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To configure the url you can use environment variables `WHATSAPP_API_HOSTNAME` and `WHATSAPP_API_PORT`.
|
||||
|
||||
By default, WAHA download all files that the account receive.
|
||||
@@ -156,6 +240,7 @@ If you want to limit files lifetime, specify file types for download or change d
|
||||
[read more about file storage configuration and variables ->]({{< relref "config" >}}).
|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Get messages
|
||||
Read messages from the history - use `GET /api/messages` endpoint.
|
||||
|
||||
@@ -15,7 +15,10 @@ We do not recommend exposing the API on any public networks!
|
||||
Either protect the API with [Api Key](https://www.fortinet.com/resources/cyberglossary/api-key) or deny access by using
|
||||
firewalls.
|
||||
|
||||
## Swagger Security 
|
||||
👉 Security options are available in [**WAHA Plus**]({{< relref "plus-version#plus" >}})  version only.
|
||||
|
||||
## Swagger Security
|
||||
### Username and password
|
||||
If you want to hide the project Swagger panel under the password - run the following command to hide under `admin/admin`
|
||||
login and password.
|
||||
|
||||
@@ -29,7 +32,20 @@ Open http://localhost:3000/ and enter `admin / admin` in the inputs:
|
||||
|
||||
{{< alert icon="👉" text="Protecting Swagger under the password does not protect your API from other request! Use both techniques to protect your API and Swagger!" />}}
|
||||
|
||||
## API security 
|
||||
### Disable Swagger
|
||||
You also can hide swagger completely by setting `WHATSAPP_SWAGGER_ENABLED=false` environment variable.
|
||||
|
||||
{{< alert icon="👉" text="Disabling Swagger does not protect the API, please use API security as well" />}}
|
||||
|
||||
## Dashboard Security
|
||||
When running WAHA you can set the following environment variables to configure the dashboard:
|
||||
- `WAHA_DASHBOARD_ENABLED=true` - enable or disable the dashboard, by default `true`. Set to `false` to disable the dashboard.
|
||||
- `WAHA_DASHBOARD_USERNAME=waha` - username used to log in, by default `waha`.
|
||||
- `WAHA_DASHBOARD_PASSWORD=waha` - password used to log in, by default `waha`.
|
||||
|
||||
Read more about [**Dashboard ->**]({{< relref "/docs/how-to/waha-dashboard" >}})
|
||||
|
||||
## API security
|
||||
|
||||
You can protect the API by requiring Api Key in a request's headers.
|
||||
|
||||
@@ -65,7 +81,7 @@ headers = {
|
||||
requests.get("http://localhost:3000/api/sessions", headers=headers)
|
||||
```
|
||||
|
||||
## Webhook security 
|
||||
## Webhook security
|
||||
To make sure that you get a webhook from your WAHA instance - you can use **HMAC authentication**.
|
||||
Read more about it on [Webhooks page ->]({{< relref "/docs/how-to/webhooks#hmac-authentication" >}})
|
||||
|
||||
@@ -6,7 +6,7 @@ date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 110
|
||||
weight: 115
|
||||
---
|
||||
|
||||
We consider that you've run docker container and authenticated the session with QR code.
|
||||
@@ -15,23 +15,40 @@ If you haven't yet - please follow the steps from [**Quick Start →**]({{< relr
|
||||
|
||||
## Fields
|
||||
There are common fields that you can find in almost all requests:
|
||||
- `session` - a session name from which account you're sending the message. We use `default` in the examples.
|
||||
- Core  version supports only `default` session.
|
||||
- Plus  allows you to run multiple sessions inside one container to save your memory and CPU resources!
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "12132132130@c.us",
|
||||
"file": "..."
|
||||
}
|
||||
```
|
||||
|
||||
### session
|
||||
`session` - a session name from which account you're sending the message. We use `default` in the examples.
|
||||
- Core  version supports only `default` session.
|
||||
- Plus  allows you to run multiple sessions inside one container to save your memory and CPU resources!
|
||||
|
||||
Read more about [multiple sessions →]({{< relref "/docs/how-to/sessions" >}})
|
||||
|
||||
- `chatId` - it's a phone number or Group identifier where you're sending the message.
|
||||
- **Phone numbers** accounts use international phone number without + at the start and add `@c.us` at the end.
|
||||
For phone number `12132132131` the `chatId` is `12132132131@c.us`.
|
||||
- **Groups** use random number with `@g.us` at the end.
|
||||
### chatId
|
||||
`chatId` - it's a phone number or Group identifier where you're sending the message.
|
||||
- **Phone numbers** accounts use international phone number without + at the start and add `@c.us` at the end.
|
||||
For phone number `12132132131` the `chatId` is `12132132131@c.us`.
|
||||
- **Groups** use random number with `@g.us` at the end.
|
||||
|
||||
> To get the actual `chatId` for **Brazilian phone number** - use `chatId` field from
|
||||
> [Check phone number exists ->]({{< relref "/docs/how-to/contacts#check-phone-number-exists" >}})
|
||||
> response.
|
||||
|
||||
### file
|
||||
When sending media (images, voice, files) you can either use:
|
||||
- `file.data` field with base64 encoded file (https://base64.guru/converter/encode/file)
|
||||
- `file.data` field [with base64 encoded file](https://base64.guru/converter/encode/file)
|
||||
- `file.url` field with public available URL for that file
|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Send text 
|
||||
### Send text
|
||||
To send text message - use `POST /api/sendText` with example payload.
|
||||
```json
|
||||
{
|
||||
@@ -40,6 +57,7 @@ To send text message - use `POST /api/sendText` with example payload.
|
||||
"text": "Hi there!"
|
||||
}
|
||||
```
|
||||
|
||||
#### Mention contact
|
||||
If you send a message in a group and want to mention a participant in the message -
|
||||
use `mentions` field for that in `POST /api/sendText` request.
|
||||
@@ -58,7 +76,7 @@ also mention it in `mentions` in format `2132132130@c.us`
|
||||
}
|
||||
```
|
||||
|
||||
### Reply on message 
|
||||
### Reply on message
|
||||
To reply on a message - use `POST /api/reply` with example payload.
|
||||
```json
|
||||
{
|
||||
@@ -69,10 +87,50 @@ To reply on a message - use `POST /api/reply` with example payload.
|
||||
}
|
||||
```
|
||||
|
||||
#### Reply files 
|
||||
WAHA does not support reply with files (images, voice, etc). If you're interested in it - please create an issue in GitHub.
|
||||
#### Reply files 
|
||||
WAHA does not support reply with files (images, voice, etc.). If you're interested in it - please create an issue in GitHub.
|
||||
|
||||
### Add a reaction 
|
||||
|
||||
### Edit message
|
||||
You can edit **text** messages or **"caption"** in media messages.
|
||||
|
||||
```
|
||||
PUT /api/{session}/chats/{chatId}/messages/{messageId}
|
||||
```
|
||||
👉 Remember to escape `@` in `chatId` and `messageId` with `%40`.
|
||||
|
||||
So if you want to edit `true_123@c.us_AAA` message in `123@c.us` chat you need to send request to:
|
||||
```
|
||||
PUT /api/{session}/chats/123%40c.us/messages/true_123%40c.us_AAA
|
||||
```
|
||||
|
||||
**Payload:**
|
||||
```json
|
||||
{
|
||||
"text": "Hello, world!"
|
||||
}
|
||||
```
|
||||
|
||||
### Delete message
|
||||
You can delete messages from the chat.
|
||||
|
||||
```
|
||||
DELETE /api/{session}/chats/{chatId}/messages/{messageId}
|
||||
```
|
||||
|
||||
👉 Remember to escape `@` in `chatId` and `messageId` with `%40`.
|
||||
|
||||
So if you want to delete `true_123@c.us_AAA` message in `123@c.us` chat you need to send request to:
|
||||
```
|
||||
DELETE /api/{session}/chats/123%40c.us/messages/true_123%40c.us_AAA
|
||||
```
|
||||
|
||||
### Send poll
|
||||
We have a dedicated page [how to send polls and receive votes]({{< relref "/docs/how-to/polls" >}})!
|
||||
|
||||

|
||||
|
||||
### Add a reaction
|
||||
Use `PUT /api/reaction` method to set reaction to a message.
|
||||
|
||||
{{< alert icon="👉" text="Reaction API uses PUT, not POST request! Please make sure you send right request." />}}
|
||||
@@ -94,6 +152,85 @@ To remove reaction from a message - send empty string in the reaction request.
|
||||
}
|
||||
```
|
||||
|
||||
### Star and unstar message
|
||||
Use `PUT /api/star` method to star or unstar a message.
|
||||
|
||||
{{< alert icon="👉" text="Star API uses PUT, not POST request! Please make sure you send right request." />}}
|
||||
|
||||
**Star:**
|
||||
```json
|
||||
{
|
||||
"messageId": "false_71111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"chatId": "71111111111@c.us",
|
||||
"star": true,
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
|
||||
**Unstar:**
|
||||
```json
|
||||
{
|
||||
"messageId": "false_71111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"chatId": "71111111111@c.us",
|
||||
"star": false,
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
|
||||
### Send contact (vcard)
|
||||
Use `POST /api/sendContactVcard` to send contact (vcard).
|
||||
|
||||
You can use fields this way:
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "79111111@c.us",
|
||||
"contacts": [
|
||||
{
|
||||
"fullName": "John Doe",
|
||||
"organization": "Company Name",
|
||||
"phoneNumber": "+91 11111 11111",
|
||||
"whatsappId": "911111111111"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Or provide a vCard file content:
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "79111111@c.us",
|
||||
"contacts": [
|
||||
{
|
||||
"vcard": "BEGIN:VCARD\nVERSION:3.0\nFN:Jane Doe\nORG:Company Name;\nTEL;type=CELL;type=VOICE;waid=911111111111:+91 11111 11111\nEND:VCARD"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Or even combine it:
|
||||
```json
|
||||
{
|
||||
"chatId": "79111111@c.us",
|
||||
"contacts": [
|
||||
{
|
||||
"vcard": "BEGIN:VCARD\nVERSION:3.0\nFN:Jane Doe\nORG:Company Name;\nTEL;type=CELL;type=VOICE;waid=911111111111:+91 11111 11111\nEND:VCARD"
|
||||
},
|
||||
{
|
||||
"fullName": "John Doe",
|
||||
"organization": "Company Name",
|
||||
"phoneNumber": "+91 11111 11111",
|
||||
"whatsappId": "911111111111"
|
||||
}
|
||||
],
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
### Send image 
|
||||
Use `POST /api/sendImage` to send images.
|
||||
|
||||
@@ -136,6 +273,8 @@ You can send voice messages in two ways:
|
||||
1. Provide a URL for the voice.
|
||||
2. Encode the whole file content into base64 and send it in the request body.
|
||||
|
||||
Please make sure your file has **OPUS** encoding and packed in OGG container.
|
||||
|
||||
#### URL
|
||||
```json
|
||||
{
|
||||
@@ -143,8 +282,7 @@ You can send voice messages in two ways:
|
||||
"chatId": "11111111111@c.us",
|
||||
"file": {
|
||||
"mimetype": "audio/ogg; codecs=opus",
|
||||
"filename": "voice-message.mp3",
|
||||
"url": "https://github.com/devlikeapro/whatsapp-http-api/raw/core/examples/dev.likeapro.mp3"
|
||||
"url": "https://github.com/devlikeapro/whatsapp-http-api/raw/core/examples/dev.likeapro.opus"
|
||||
},
|
||||
"caption": "string"
|
||||
}
|
||||
@@ -163,6 +301,44 @@ You can send voice messages in two ways:
|
||||
}
|
||||
```
|
||||
|
||||
### Send video 
|
||||
Use `POST /api/sendVideo` to send a message with a video attached.
|
||||
|
||||
For **WEBJS** engine please use `devlikeapro/whatsapp-http-api-plus:chrome` docker image.
|
||||
Read more about [**Docker images and engines →**]({{< relref "/docs/how-to/engines" >}}).
|
||||
|
||||
You can send voice messages in two ways:
|
||||
1. Provide a URL for the file and the API will download it and send it in the request body.
|
||||
2. Provide the file as a base64 string in the request body.
|
||||
|
||||
#### URL
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "11111111111@c.us",
|
||||
"caption": "Watch this video!",
|
||||
"file": {
|
||||
"mimetype": "video/mp4",
|
||||
"filename": "video.mp4",
|
||||
"url": "https://github.com/devlikeapro/whatsapp-http-api/raw/core/examples/video.mp4"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Base64
|
||||
```json
|
||||
{
|
||||
"chatId": "11111111111@c.us",
|
||||
"caption": "Watch this video!",
|
||||
"file": {
|
||||
"mimetype": "video/mp4",
|
||||
"filename": "video.mp4",
|
||||
"data": "AAAAGGZ0eXBtcDQyAAAAAGlzb21tcDQyAAAHEW1vb3YAAABsbXZoZAAAAADgAUTa4AFE2gAAdTAAAHe6AAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAANzdHJhawAAAFx0a2hkAAAAA+ABRNrgAUTaAAAAAQAAAAAAAHVOAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAUAAAAC0AAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAB1TgAAA+kAAQAAAAAC621kaWEAAAAgbWRoZAAAAADgAUTa4AFE2gAAdTAAAHVOVcQAAAAAAF9oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAASVNPIE1lZGlhIGZpbGUgcHJvZHVjZWQgYnkgR29vZ2xlIEluYy4gQ3JlYXRlZCBvbjogMDIvMDIvMjAyMy4AAAACZG1pbmYAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAIkc3RibAAAAJhzdHNkAAAAAAAAAAEAAACIYXZjMQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAUAAtAASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADJhdmNDAWQAH//hABtnZAAfrNEAUAW7AWoCAgKAAAH0gAB1MAeMGIkBAARo648sAAAAGHN0dHMAAAAAAAAAAQAAAB4AAAPpAAAAKHN0c2MAAAAAAAAAAgAAAAEAAAAOAAAAAQAAAAMAAAACAAAAAQAAABxzdGNvAAAAAAAAAAMAAAcxAAAq7wAAS24AAACMc3RzegAAAAAAAAAAAAAAHgAAA0kAAAAyAAAAJQAAACYAAAAmAAAAKQAAACUAAAAlAAAAJQAAACkAAAAlAAAAJQAAACUAAAApAAAAJAAAACQAAAAkAAAAJwAAACQAAAAkAAAAJQAAACYAAAAlAAAAJQAAACUAAAAmAAAAJQAAACUAAAAlAAAAKgAAABRzdHNzAAAAAAAAAAEAAAABAAAAiGN0dHMAAAAAAAAADwAAAAEAAAPpAAAAAQAAD6QAAAADAAAAAAAAAAEAAA+kAAAAAwAAAAAAAAABAAAPpAAAAAMAAAAAAAAAAQAAD6QAAAADAAAAAAAAAAEAAA+kAAAAAwAAAAAAAAABAAAPpAAAAAMAAAAAAAAAAQAAE40AAAAEAAAAAAAAABR2bWhkAAAAAQAAAAAAAAAAAAACuHRyYWsAAABcdGtoZAAAAAPgAUTa4AFE2gAAAAIAAAAAAAB3ugAAAAAAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAlRtZGlhAAAAIG1kaGQAAAAA4AFE2uABRNoAAKxEAACwABXHAAAAAABfaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAElTTyBNZWRpYSBmaWxlIHByb2R1Y2VkIGJ5IEdvb2dsZSBJbmMuIENyZWF0ZWQgb246IDAyLzAyLzIwMjMuAAAAAc1taW5mAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABkXN0YmwAAABpc3RzZAAAAAAAAAABAAAAWW1wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAACsRAAAAAAANWVzZHMAAAAAAycAAgAEH0AVAAAAAAAAAAAAAAAFEBIQAAAAAAAAAAAAAAAAAAAGAQIAAAAYc3R0cwAAAAAAAAABAAAALAAABAAAAAAoc3RzYwAAAAAAAAACAAAAAQAAABUAAAABAAAAAwAAAAIAAAABAAAAHHN0Y28AAAAAAAAAAwAADHYAACz0AABLvQAAAMRzdHN6AAAAAAAAAAAAAAAsAAABcwAAAXQAAAFzAAABdAAAAXMAAAF0AAABcwAAAXQAAAFzAAABdAAAAXMAAAF0AAABcwAAAXQAAAFzAAABdAAAAXMAAAF0AAABcwAAAXQAAAFzAAABdAAAAXMAAAF0AAABcwAAAXQAAAF0AAABcwAAAXQAAAFzAAABdAAAAXMAAAF0AAABcwAAAXQAAAFzAAABdAAAAXMAAAF0AAABcwAAAXQAAAFzAAABdAAAAXMAAAAQc21oZAAAAAAAAAAAAAAAcnVkdGEAAABqbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAA9aWxzdAAAABlnc3N0AAAAEWRhdGEAAAABAAAAADAAAAAcZ3N0ZAAAABRkYXRhAAAAAQAAAAAxMDY4AABHe21kYXQAAANFJbhABd/+9Y2vmWVRi0/fwl7Vp8FFIlFodBXWJ7AAAAMAAAMAAAMAAAMCb3w7b+xvu484N6S/wPJaC8sMAAADApIAAAxYAAEIAAAaIAAD7AAAqQAAIeAABmgAAcgAAHOAACMgAAnwAAPEAAADAAADAAADAAADAAADAAADAAADAAADAAADAAADAAAzkv4VetcGPbngLXvkqeR7JxISR12BgR++cnsBM31J1hURZirB4HGwWvpFdPC289mAkjXLCSyIdvFR3dv6aHr0B82L8J9Xog23WabSqb8cO+rmTPXAgY7aaIpgPquTfAAAJQGERBcipJr4m65wx3o3poM4QuaQq1SlHkzKL3Tov43kRfCoIa5GVUZ6CE6rriYcm72C827hp2mDdqNx6fHB1jsnRsQxit03/N5XMsHAWWiLnLJlru6Fjs4nF8PgsKqHV100N02/K4Lui85ShIhYz0cYsI7cmrr9AQCKLf3rbXvAOQEK9iZ3ELwGrUemoiVtzbbFzFplif1tWr4bGWSBRmylGBomUYqlh1w2hY5WSz2e+e7EcHvZ3AoMWZIUkvohRPbA016vF3x1mlXVR5P1rFnPwA9O12c73pWqAnTtHi4IAABARcfYC/FQsIkx5nfpXAi1MP7Uyt1kxrRbxQyilN42vcIBU33ywVC0b3cmIpGpnrZ4Z8LXriYPNJkqXUN5+h61ktEcZ1ymfgp77JtlJItHJN+fuhrxPY8HucNaFPQrChl1Ud+EN4SuQWg4TvEUl5O7cM275b8BOxJtWfRMVkuL/A93UIq3SWPbsd9Dd06g+obkwgq9up6u9YZkWczBlwDmK5gitbPbKN4o1ZI7AAAOLsX06bPLKB01V+iAw3xjzslG/7US1WFR/CRaZZ5EIoPL0xOxVV/wmQeGC5YwF7JNsJLtWzbrAJl/y1td4SJ5Tw1iu0O1RsxzaEkmLjU/lPicm/sSMjMcK1Tw4SwcuwXwlCRbCcqWoNDNOJZK3+YBqxBc8XHcOrAAAJCIWAAAvoK4AAQw+gAAefAAAB/vwAAQwIAADMiAAA+XoAAZvgAAOJsAAK8cAAKXMAAKNgAANGgAAVBAAACTAAAFAAADAC5AAAIMAAAaMVdIAAAALiHiTIXf/eEAAAMAAAMAAAMAAAMCGogH7ip1N+0CWY7DPZHZwAAAAwAAAwAEHaAAAAAhAakHyLf/AAADAAADAAADAAADABkThmAAAAMAAAMAAxaIAAAAIgGpC8jX/wAAAwAAAwAAAwAAAwAVSr7ewAAAAwAAAwAHXcAAAAAiAakPyNf/AAADAAADAAADAAADABVKvt7AAAADAAADAAddwAAAACUh5IohV//8hAAAAwAAAwAAAwAAAwAEcKP8u5AAAAMAAAMAAQdwAAAAIQGpl8i3/wAAAwAAAwAAAwAAAwAZE4ZgAAADAAADAAMWiAAAACEBqZvIt/8AAAMAAAMAAAMAAAMAGROGYAAAAwAAAwADFogAAAAhAamfyLf/AAADAAADAAADAAADABkThmAAAAMAAAMAAxaIAAAAJSHmyiE3//pYAAADAAADAAADAAADAAi4gzWuQAAAAwAAAwADMiAAAAAhAaonyJf/AAADAAADAAADAAADAByn5+AAAAMAAAMABN2QAAAAIQGqK8iX/wAAAwAAAwAAAwAAAwAcp+fgAAADAAADAATdkAAAACEBqi/Il/8AAAMAAAMAAAMAAAMAHKfn4AAAAwAAAwAE3ZAAAAAlIekKIRf/+lgAAAMAAAMAAAMAAAMACLPP13NAAAADAAADAAO6YCEABQCgG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADenAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB7IRAFAKAb/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALine truncated
|
||||
},
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
|
||||
### Send file 
|
||||
Use `POST /api/sendFile` to send a file as a document.
|
||||
|
||||
@@ -173,13 +349,14 @@ You can send files in two ways:
|
||||
#### URL
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"caption": "Check this out!",
|
||||
"chatId": "11111111111@c.us",
|
||||
"file": {
|
||||
"mimetype": "image/jpeg",
|
||||
"filename": "filename.jpeg",
|
||||
"url": "https://github.com/devlikeapro/whatsapp-http-api/raw/main/docs/dev.likeapro.jpg"
|
||||
},
|
||||
"session": "default"
|
||||
"url": "https://raw.githubusercontent.com/devlikeapro/whatsapp-http-api/core/examples/video.mp4"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -199,7 +376,7 @@ You can send files in two ways:
|
||||
|
||||
|
||||
### Send status (aka stories)
|
||||
With [NOWEB engine]({{< relref "/docs/how-to/engines" >}}) you can send statuses (aka stories)!
|
||||
You can send statuses (aka stories)!
|
||||
|
||||
It is always necessary to inform the list of `contacts` that will have access to the posted status!
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 50 KiB |
@@ -9,7 +9,8 @@ images: [ ]
|
||||
weight: 125
|
||||
---
|
||||
|
||||
## Sessions
|
||||
## Endpoints
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Start
|
||||
|
||||
@@ -83,6 +84,20 @@ Read more about it in [Autostart section](#autostart).
|
||||
You can configure proxy when for all sessions by set up environment variables.
|
||||
Read more about it on [**Configuration page** ->]({{< relref "/docs/how-to/config#proxy" >}}).
|
||||
|
||||
#### Enable debug
|
||||
You can enable debug mode for a session by setting `config.debug` field to `true`.
|
||||
It'll show you more logs in the console.
|
||||
Can be useful for debugging purposes when you're experiencing some issues.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"debug": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### List
|
||||
|
||||
To get session list - call `GET /api/sessions`.
|
||||
@@ -93,7 +108,30 @@ The response:
|
||||
[
|
||||
{
|
||||
"name": "default",
|
||||
"status": "STARTING"
|
||||
"status": "WORKING",
|
||||
"config": {
|
||||
"proxy": null,
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message",
|
||||
"session.status"
|
||||
],
|
||||
"hmac": null,
|
||||
"retries": null,
|
||||
"customHeaders": null
|
||||
}
|
||||
],
|
||||
"debug": false
|
||||
},
|
||||
"me": {
|
||||
"id": "79111111@c.us",
|
||||
"pushName": "WAHA"
|
||||
},
|
||||
"engine": {
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
@@ -102,6 +140,38 @@ You can add `?all=true` parameter to the request `GET /api/session?all=True` it'
|
||||
including **STOPPED**,
|
||||
so you can know which one will be restarted if you set `WHATSAPP_RESTART_ALL_SESSIONS=True` environment variable.
|
||||
|
||||
### Get session
|
||||
To get information about a specific session - call `GET /api/sessions/{session}`.
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"status": "WORKING",
|
||||
"config": {
|
||||
"proxy": null,
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message",
|
||||
"session.status"
|
||||
],
|
||||
"hmac": null,
|
||||
"retries": null,
|
||||
"customHeaders": null
|
||||
}
|
||||
],
|
||||
"debug": false
|
||||
},
|
||||
"me": {
|
||||
"id": "79111111@c.us",
|
||||
"pushName": "WAHA"
|
||||
},
|
||||
"engine": {
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Stop
|
||||
|
||||
In order to stop a new session - call `POST /api/sessions/stop`
|
||||
@@ -127,18 +197,115 @@ In order to log out the session - call `POST /api/sessions/logout`
|
||||
"logout": true
|
||||
}
|
||||
```
|
||||
### Get screenshot
|
||||
Get screenshot of the session's screen.
|
||||
|
||||
```bash
|
||||
GET /api/screenshot?session=default
|
||||
```
|
||||
|
||||
#### Get screenshot in Base64
|
||||
You can get screenshot in base64 format by adding `Accept: application/json` header to the request.
|
||||
|
||||
```bash
|
||||
GET /api/screenshot?session=default
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"mimetype": "image/png",
|
||||
"data": "base64-encoded-data"
|
||||
}
|
||||
```
|
||||
|
||||
You can change it in Swagger by clicking on **Media Type** dropdown and selecting **application/json**:
|
||||
|
||||

|
||||
|
||||
|
||||
### Get me
|
||||
|
||||
Get information about the associated account for that session (if any).
|
||||
```bash
|
||||
GET /api/sessions/{session}/me
|
||||
```
|
||||
|
||||
**Authenticated and working** session's response:
|
||||
```json
|
||||
{
|
||||
"id": "11111111111@c.us",
|
||||
"pushName": "string"
|
||||
}
|
||||
```
|
||||
|
||||
**Stopped** or **not authenticated** session returns null:
|
||||
```json
|
||||
null
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Authentication
|
||||
### Get QR
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
The simplest way to authenticate a new session - get QR code and scan it on your device.
|
||||
```bash
|
||||
GET /api/{session}/auth/qr
|
||||
```
|
||||
You'll get QR image that you can scan and get authenticated
|
||||
|
||||
#### QR formats
|
||||
You can get QR in different formats:
|
||||
1. **binary image** - `GET /api/{session}/auth/qr`
|
||||
2. **base64 image** - `GET /api/{session}/auth/qr` and set `Accept: application/json` header
|
||||
3. **raw** - `GET /api/{session}/auth/qr?format=raw`
|
||||
|
||||
Here's detailed information about each format:
|
||||
|
||||
1. **binary image**, binary image - **default** format, you'll get image in response
|
||||
```bash
|
||||
# Get image - binary
|
||||
GET /api/{session}/auth/qr
|
||||
|
||||
# OR
|
||||
GET /api/{session}/auth/qr?format=image
|
||||
|
||||
# OR specify Accept header as well
|
||||
GET /api/{session}/auth/qr?format=image
|
||||
Accept: image/png
|
||||
```
|
||||
|
||||
2. **base64 image** - you'll get image in base64 format in response if you set `Accept: application/json` header.
|
||||
```bash
|
||||
GET /api/{session}/auth/qr?format=image
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"mimetype": "image/png",
|
||||
"data": "base64-encoded-data"
|
||||
}
|
||||
```
|
||||
|
||||
You can change it in Swagger by clicking on **Media Type** dropdown and selecting **application/json**:
|
||||
|
||||

|
||||
|
||||
3. **raw** - you'll get raw data in response, you can use it to generate QR code on your side
|
||||
```bash
|
||||
GET /api/{session}/auth/qr?format=raw
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"value": "value-that-you-need-to-use-to-generate-qr-code"
|
||||
}
|
||||
```
|
||||
|
||||
### Get pairing code
|
||||
{{< alert icon="👉" text="Available in **NOWEB** engine only." />}}
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
You can [link a session with phone number](https://faq.whatsapp.com/1324084875126592) - make a request to the endpoint.
|
||||
```bash
|
||||
@@ -160,6 +327,39 @@ You'll get code in the response that you can use on your WhatsApp app to connect
|
||||
```
|
||||
|
||||
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### session.status
|
||||
The `session.status` event is triggered when the session status changes.
|
||||
- `STOPPED` - session is stopped
|
||||
- `STARTING` - session is starting
|
||||
- `SCAN_QR_CODE` - session is required to scan QR code or login via phone number.
|
||||
- When you receive the `session.status` event with `SCAN_QR_CODE` status, you can [**fetch updated QR ->**]({{< relref "/docs/how-to/sessions#get-qr" >}})
|
||||
- The `SCAN_QR_CODE` is issued every time when QR updated (WhatsApp requirements)
|
||||
- `WORKING` - session is working and ready to use
|
||||
- `FAILED` - session is failed due to some error. It's likely that authorization is required again or device has been disconnected from that account.
|
||||
Try to restart the session and if it doesn't help - logout and start the session again.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "session.status",
|
||||
"session": "default",
|
||||
"me": {
|
||||
"id": "7911111@c.us",
|
||||
"pushName": "~"
|
||||
},
|
||||
"payload": {
|
||||
"status": "WORKING"
|
||||
},
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"version": "2023.10.12",
|
||||
"engine": "WEBJS",
|
||||
"tier": "PLUS"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Advanced sessions 
|
||||
@@ -169,28 +369,8 @@ configure autostart options so when the docker container restarts - it restores
|
||||
|
||||
### Session persistent
|
||||
|
||||
#### File storage
|
||||
If you want to save your session and do not scan QR code everytime when you launch WAHA - connect a local file storage
|
||||
to the container. WAHA stores authentication information in the directory and reuses it after restart.
|
||||
|
||||
[Attach volume](https://docs.docker.com/storage/volumes/) part to the command:
|
||||
|
||||
```bash
|
||||
-v `pwd`/.sessions:/app/.sessions
|
||||
```
|
||||
|
||||
The full command would be:
|
||||
|
||||
```bash
|
||||
docker run --rm -d -v `pwd`/.sessions:/app/.sessions -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
#### Remote storage 
|
||||
|
||||
If you're interested in using some "remote" storage (like Redis or other Databases) to save sessions - please create an
|
||||
issue on GitHub.
|
||||
|
||||
For instances, it may be useful if you run WAHA in a cluster of servers and do not have shared file storage
|
||||
If you want to save your session and do not scan QR code everytime when you launch WAHA -
|
||||
[connect the session storage to the container ->]({{< relref "/docs/how-to/storages#sessions" >}})
|
||||
|
||||
### Autostart
|
||||
If you don't want to call `POST /api/sessions/start` for every session each time when the container restart -
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
---
|
||||
title: "Storages"
|
||||
description: "Storages"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 700
|
||||
---
|
||||
There are several storages that are used by the WAHA, below you can find the list of them and the way to configure them.
|
||||
1. [Sessions](#sessions) - used to store the session data, such as authentication information, configuration, and other data that is required to keep the session alive and connected to WhatsApp.
|
||||
2. [Media](#media) - used to store the media files, such as images, videos, and other files that are received from the WhatsApp instance.
|
||||
|
||||
<b>Storages are available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
## Sessions
|
||||
The "Sessions" storage is used to store the session data, such as authentication information, configuration,
|
||||
and other data that is required to keep the session alive and connected to WhatsApp.
|
||||
|
||||
If you want to save your session and do not scan QR code everytime when you launch WAHA -
|
||||
connect the session storage to the container.
|
||||
|
||||
For the session storage, you can use the following options:
|
||||
1. [Local (files)](#local-files) - the default option, stores the session data in the local storage using files.
|
||||
2. [MongoDB](#mongodb) - stores the session data in the MongoDB database.
|
||||
|
||||
The following table shows the compatibility of the session storage with the engines:
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|---------------|:-----:|:-----:|:-----:|
|
||||
| Local (files) | ✔️ | ✔️ | ✔️ |
|
||||
| MongoDB | ✔️ | ✔️ | ➖ |
|
||||
|
||||
## Sessions - Local (files)
|
||||
By default, the WAHA uses the **local storage (files)** to store the session data.
|
||||
|
||||
{{< alert icon="💡" text="It's <b>well tested solution</b> even for production" />}}
|
||||
|
||||
In order to use the local storage and save the session data between the container restarts,
|
||||
you need to mount the volume to the `/app/.sessions` directory using the `-v` option in `docker run` command:
|
||||
|
||||
```bash
|
||||
-v /path/to/on/host/.sessions:/app/.sessions
|
||||
```
|
||||
|
||||
The full command to run the WAHA with the local storage and save the session data
|
||||
in the current directory and `.sessions` directory:
|
||||
```bash
|
||||
docker run -v `pwd`/.sessions:/app/.sessions -p 3000:3000/tcp devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
This is the only action you need to do to use the local storage - all session data will be available between the container restarts.
|
||||
|
||||
### How it works
|
||||
In the host machine, the session data will be stored in the current directory in the `.sessions` directory.
|
||||
|
||||
Under the hood, the WAHA stores the session data in the following directory structure:
|
||||
```
|
||||
.sessions/{engine}/{sessionName}/...
|
||||
```
|
||||
when you "logout" the session using [POST /api/sessions/logout]({{< relref "/docs/how-to/sessions#logout">}}) or providing `logout: True` in [POST /api/sessions/stop]({{< relref "/docs/how-to/sessions#stop">}})
|
||||
it removes the directory with the session data.
|
||||
|
||||
### Health Check
|
||||
The [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) provides [the health check endpoint]({{< relref "/docs/how-to/other" >}}) that checks the local storage.
|
||||
|
||||
## Sessions - MongoDB
|
||||
If you want to use the MongoDB to store the session data, you need to:
|
||||
1. Start the MongoDB server (using docker or any other way). You can either start your own MongoDB server or use the one of cloud providers, like [MongoDB Atlas](https://www.mongodb.com/atlas/database).
|
||||
2. Set `WHATSAPP_SESSIONS_MONGO_URL=mongodb://user:password@host:port/` environment variable to connect to the MongoDB server.
|
||||
|
||||
|
||||
**We recommend using your own MongoDB server as close as possible to WAHA server** for the best performance and security reasons.
|
||||
|
||||
{{< alert icon="💡" text="For <b>WEBJS</b> engine it can take up to 1 minute to save credentials in Mongo Database" />}}
|
||||
|
||||
### Example
|
||||
First, you need to start MongoDB server:
|
||||
```bash
|
||||
docker run -d -p 27017:27017 --name mongodb mongo
|
||||
```
|
||||
|
||||
Then, you need to run the WAHA with the `WHATSAPP_SESSIONS_MONGO_URL` environment variable (please note using `--network host` option as well)
|
||||
```bash
|
||||
docker run -e WHATSAPP_SESSIONS_MONGO_URL=mongodb://localhost:27017/ --network host devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
This is the only action you need to do to use the MongoDB storage -
|
||||
all session authentication data will be stored in the MongoDB database.
|
||||
|
||||
### How it works
|
||||
When you start a session, it stores the session data in the MongoDB database in two databases:
|
||||
1. `waha_{engine}` - it saves the session configuration in `sessions` collection with `name: {sessionName}` field.
|
||||
2. `waha_{engine}_{sessionName}` - it saves the WhatsApp authentication data and other session data. Each engine saves different data in this database.
|
||||
|
||||
When you "logout" the session using [POST /api/sessions/logout]({{< relref "/docs/how-to/sessions#logout">}}) or providing `logout: True` in [POST /api/sessions/stop]({{< relref "/docs/how-to/sessions#stop">}}) it removes those databases or elements from them.
|
||||
|
||||
For dealing and troubleshooting with the MongoDB, we recommend using [MongoDB Compass](https://www.mongodb.com/products/tools/compass).
|
||||
|
||||

|
||||
|
||||
### MongoDB Atlas
|
||||
If you use the [MongoDB Atlas](https://www.mongodb.com/atlas/database) you must grant
|
||||
`Atlas Admin` role in **Security => Database Access** before you connect to the database.
|
||||
|
||||
For production please consider running the MongoDB server close to the WAHA server for the best performance and security reasons.
|
||||
|
||||
### Health Check
|
||||
The [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) provides [the health check endpoint]({{< relref "/docs/how-to/other" >}}) that checks the MongoDB connection.
|
||||
|
||||
## Media
|
||||
When your WhatsApp instance receives media files, it stores them in the media storage.
|
||||
|
||||
You can use the following options to store the media files:
|
||||
1. [Local](#local) - the default option, stores the media files in the local storage using files.
|
||||
2. [S3](#s3) - stores the media files in the S3 storage.
|
||||
|
||||
Read more about [available configuration options ->]({{<relref "/docs/how-to/config#files">}}).
|
||||
|
||||
The following table shows the compatibility of the storage with the engines:
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|-------|:-----:|:-----:|:-----:|
|
||||
| Local | ✔️ | ✔️ | ✔️ |
|
||||
| S3 | 🕒 | 🕒 | ➖ |
|
||||
|
||||
## Media - Local
|
||||
By default, the WAHA uses the **local file storage** to store the media files and those files has a short lifetime (180 seconds).
|
||||
So it's your app responsibility to download and store them in a safe persistent place during this time.
|
||||
|
||||
### Save media files between the container restarts
|
||||
If you want to use the local storage and **save the media files between the container restarts for a long time** - you need to:
|
||||
1. Specify a dedicated folder to store the media files using `WHATSAPP_FILES_FOLDER=/app/.media` environment variable
|
||||
2. Disable automatic media files cleanup using `WHATSAPP_FILES_LIFETIME=0` environment variable
|
||||
3. Connect the volume to the specified folder using the `-v /path/to/files/on/host:/app/.media` option in `docker run` command to the folder specified in `WHATSAPP_FILES_FOLDER` environment variable.
|
||||
|
||||
Read more about [available configuration options ->]({{<relref "/docs/how-to/config#files">}}).
|
||||
|
||||
Here's all the steps in one command:
|
||||
```bash
|
||||
docker run -v /path/to/on/host/.media:/app/.media -e WHATSAPP_FILES_FOLDER=/app/.media -e WHATSAPP_FILES_LIFETIME=0 -p 3000:3000/tcp devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
### Health Check
|
||||
The [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) provides [the health check endpoint]({{< relref "/docs/how-to/other" >}}) that checks the local storage.
|
||||
|
||||
## Media - S3
|
||||
If you're interested in using the S3 storage or any other cloud storage (like [self-hosted S3 - Minio](https://min.io/)),
|
||||
please create an issue or vote for the S3 issue in [the GitHub repository](https://github.com/devlikeapro/whatsapp-http-api/issues?q=is%3Aissue+is%3Aopen+S3).
|
||||
|
After Width: | Height: | Size: 72 KiB |
@@ -0,0 +1,60 @@
|
||||
---
|
||||
title: "Swagger (OpenAPI)"
|
||||
description: "Swagger (OpenAPI)"
|
||||
lead: ""
|
||||
date: 2020-10-06t08:48:45+00:00
|
||||
lastmod: 2020-10-06t08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 111
|
||||
---
|
||||
|
||||
## Overview
|
||||
The project provides HTTP API (REST), which is documented with OpenAPI specification and Swagger UI.
|
||||
|
||||
<video autoplay loop muted playsinline controls='noremoteplayback' width="100%" poster='/images/swagger.png'>
|
||||
<source src="/videos/swagger-overview.webm" type="video/webm" />
|
||||
Download the <a href="/videos/swagger-overview.webm">Swagger Overview video</a> .
|
||||
</video>
|
||||
|
||||
You can see all available endpoints, request/response examples, and even execute them directly from the Swagger UI.
|
||||
|
||||
Later version:
|
||||
- [OpenAPI specification ->](/swagger/openapi.json)
|
||||
- [Swagger documentation ->](/swagger)
|
||||
|
||||
You can find Swagger documentation on the following url after you
|
||||
[install and started]( {{< relref "/docs/how-to/install" >}}) it:
|
||||
- Swagger: [http://localhost:3000](http://localhost:3000).
|
||||
- OpenAPI: [http://localhost:3000/-json](http://localhost:3000/-json).
|
||||
|
||||
## Configuration
|
||||
- `WHATSAPP_SWAGGER_CONFIG_ADVANCED=true` - enables advanced configuration options for Swagger documentation - you can customize host, port and base URL for the requests.
|
||||
Disabled by default.
|
||||
- `WHATSAPP_SWAGGER_ENABLED=false` - disables Swagger documentation. Enabled by default. Available in **WAHA Plus** only.
|
||||
- `WHATSAPP_SWAGGER_USERNAME=admin` and `WHATSAPP_SWAGGER_PASSWORD=admin` - these variables can be used to protect the Swagger panel
|
||||
with `admin / admin` credentials. This does not affect API access. Available in **WAHA Plus** only.
|
||||
|
||||
Read more about security settings for Swagger and API on [**Security page** ->]({{< relref "/docs/how-to/security" >}}).
|
||||
|
||||
### White label
|
||||
You can show your own brand in the Swagger documentation.
|
||||
|
||||
<img src="swagger-white-label.png" onclick="window.open(this.src)" style="cursor: pointer;">
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
👉 Swagger White Label is available in [**WAHA Plus**]({{< relref "plus-version#plus" >}})  version only.
|
||||
|
||||
Use the following environment variables to customize the Swagger documentation:
|
||||
- `WHATSAPP_SWAGGER_TITLE` - the title of the Swagger documentation and some other places.
|
||||
- `WHATSAPP_SWAGGER_DESCRIPTION` - Markdown formatted description of your API.
|
||||
- `WHATSAPP_SWAGGER_EXTERNAL_DOC_URL` - URL to the external documentation.
|
||||
|
||||
**Example** (consider using [docker-compose](https://github.com/devlikeapro/whatsapp-http-api/blob/core/docker-compose.yaml#L15-L38) or other methods to store these settings):
|
||||
```bash
|
||||
docker run -it -p 3000:3000 -e WHATSAPP_SWAGGER_TITLE="AwesomeCRM" -e 'WHATSAPP_SWAGGER_DESCRIPTION=<p>FantasticFindz - Discover unique treasures from around the world at unbelievable prices!<br/> <a href='https://google.com'>Read more about us!</a></p>' -e "WHATSAPP_SWAGGER_EXTERNAL_DOC_URL=https://google.com" devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 89 KiB |
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: "Dashboard"
|
||||
description: "Dashboard"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 110
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
**Dashboard** is a UI to manage your WhatsApp sessions!
|
||||
|
||||
<video autoplay loop muted playsinline controls='noremoteplayback' width="100%" poster='/images/waha-dashboard.png'>
|
||||
<source src="/videos/waha-dashboard-overview.webm" type="video/webm" />
|
||||
Download the <a href="/videos/waha-dashboard-overview.webm">Dashboard Overview video</a> .
|
||||
</video>
|
||||
|
||||
👉 **Dashboard** is available in [**WAHA Plus**]({{< relref "plus-version#plus" >}})  version only.
|
||||
|
||||
You can access **Dashboard** by running the project and opening
|
||||
<a href="http://localhost:3000/dashboard" target="_blank">http://localhost:3000/dashboard</a>
|
||||
(or similar, but with <a href="/dashboard" target="_blank">/dashboard</a> at the end).
|
||||
|
||||
ℹ️ **Default username and password**: `waha/waha`
|
||||
|
||||
```bash
|
||||
docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
If you're using [API Key]({{< relref "security" >}}), remember to set up the key in the dashboard.
|
||||
|
||||

|
||||
|
||||
## Configuration
|
||||
|
||||
When running WAHA you can set the following environment variables to configure the dashboard:
|
||||
|
||||
- `WAHA_DASHBOARD_ENABLED=true` - enable or disable the dashboard, by default `true`. Set to `false` to disable the
|
||||
dashboard.
|
||||
- `WAHA_DASHBOARD_USERNAME=waha` - username used to log in, by default `waha`.
|
||||
- `WAHA_DASHBOARD_PASSWORD=waha` - password used to log in, by default `waha`.
|
||||
|
||||
```bash
|
||||
docker run -it -p 3000:3000/tcp -e WAHA_DASHBOARD_USERNAME=waha -e WAHA_DASHBOARD_PASSWORD=waha devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
## Multiple servers
|
||||
If you wish to connect, control and manage multiple servers in a single "dashboard", consider using
|
||||
[WAHA Hub]({{< relref "/docs/waha-hub/introduction" >}}) - central management server to help you build reliable infrastructure!
|
||||
|
||||
## Bug reports and feature requests
|
||||
If you're experiencing any issues or have a feature request, please create an issue in the
|
||||
[WAHA GitHub](https://github.com/devlikeapro/whatsapp-http-api/issues)
|
||||
|
||||
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 73 KiB |
@@ -88,8 +88,15 @@ On the URL that you set you'll receive **HTTP POST** request with a JSON string
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"tier": "PLUS",
|
||||
"version": "2023.10.12"
|
||||
},
|
||||
"me": {
|
||||
"id": "71111111111@c.us",
|
||||
"pushName": "~"
|
||||
},
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -108,7 +115,39 @@ docker run -it -e "WHATSAPP_HOOK_EVENTS=*" -e WHATSAPP_HOOK_URL=https://httpbin.
|
||||
|
||||
|
||||
|
||||
## Events
|
||||
## Webhooks
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### session.status
|
||||
The `session.status` event is triggered when the session status changes.
|
||||
- `STOPPED` - session is stopped
|
||||
- `STARTING` - session is starting
|
||||
- `SCAN_QR_CODE` - session is required to scan QR code or login via phone number
|
||||
- When you receive the `session.status` event with `SCAN_QR_CODE` status, you can [**fetch updated QR ->**]({{< relref "/docs/how-to/sessions#get-qr" >}})
|
||||
- The `SCAN_QR_CODE` is issued every time when QR updated (WhatsApp requirements)
|
||||
- `WORKING` - session is working and ready to use
|
||||
- `FAILED` - session is failed due to some error. It's likely that authorization is required again or device has been disconnected from that account.
|
||||
Try to restart the session and if it doesn't help - logout and start the session again.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "session.status",
|
||||
"session": "default",
|
||||
"me": {
|
||||
"id": "7911111@c.us",
|
||||
"pushName": "~"
|
||||
},
|
||||
"payload": {
|
||||
"status": "WORKING"
|
||||
},
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"version": "2023.10.12",
|
||||
"engine": "WEBJS",
|
||||
"tier": "PLUS"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### message
|
||||
|
||||
@@ -189,6 +228,43 @@ Fired on all message creations, including your own. The payload is the same as f
|
||||
}
|
||||
```
|
||||
|
||||
### message.reaction
|
||||
Receive events when a message is reacted to by a user (or **yourself** reacting to a message).
|
||||
- `payload.reaction.text` - emoji that was used to react to the message. It'll be an empty string if the reaction was removed.
|
||||
- `payload.reaction.messageId` - id of the message that was reacted to.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.reaction",
|
||||
"session": "default",
|
||||
"me": {
|
||||
"id": "79222222222@c.us",
|
||||
"pushName": "WAHA"
|
||||
},
|
||||
"payload": {
|
||||
"id": "false_79111111@c.us_11111111111111111111111111111111",
|
||||
"from": "79111111@c.us",
|
||||
"fromMe": false,
|
||||
"participant": "79111111@c.us",
|
||||
"to": "79111111@c.us",
|
||||
"timestamp": 1710481111.853,
|
||||
"reaction": {
|
||||
"text": "🙏",
|
||||
"messageId": "true_79111111@c.us_11111111111111111111111111111111"
|
||||
}
|
||||
},
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"version": "2024.3.3",
|
||||
"engine": "WEBJS",
|
||||
"tier": "PLUS",
|
||||
"browser": "/usr/bin/google-chrome-stable"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{{< alert icon="👉" text="NOWEB engine note - reactions were sent in 'message' and 'message.any' events, not it's available only in 'message.reaction'!" />}}
|
||||
|
||||
### message.ack
|
||||
Receive events when server or recipient gets the message, read or played it.
|
||||
|
||||
@@ -220,6 +296,35 @@ The payload may have more fields, it depends on the engine you use, but here's a
|
||||
}
|
||||
```
|
||||
|
||||
### message.revoked
|
||||
The `message.revoked` event is triggered when a user, whether it be you or any other participant,
|
||||
revokes a previously sent message.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.revoked",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"before": {
|
||||
"id": "some-id-here",
|
||||
"timestamp": "some-timestamp-here",
|
||||
"body": "Hi there!"
|
||||
},
|
||||
"after": {
|
||||
"id": "some-id-here",
|
||||
"timestamp": "some-timestamp-here",
|
||||
"body": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Important notes**:
|
||||
1. The above messages' ids don't match any of the ids you'll receive in the `message` event, it's a different id.
|
||||
2. In order to find the message that was revoked, you'll need to search for the message with
|
||||
the same timestamp and chat id as the one in the `after` object.
|
||||
3. `before` field can be null in some cases.
|
||||
|
||||
### state.change
|
||||
|
||||
It's an internal engine's state, not **session** `status`.
|
||||
@@ -284,6 +389,60 @@ It's an internal engine's state, not **session** `status`.
|
||||
}
|
||||
```
|
||||
|
||||
### poll.vote
|
||||
We have a dedicated page [how to send polls and receive votes]({{< relref "/docs/how-to/polls" >}})!
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_1111111111@c.us_83ACBE602A05C79B234B54415E95EE8A",
|
||||
"to": "me",
|
||||
"from": "1111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": ["Awesome!"],
|
||||
"timestamp": 1692861427
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_1111111111@c.us_BAE5F2EF5C69001E",
|
||||
"to": "1111111111@c.us",
|
||||
"from": "me",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
### poll.vote.failed
|
||||
We have a dedicated page [how to send polls and receive votes]({{< relref "/docs/how-to/polls" >}})!
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote.failed",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_11111111111@c.us_2E8C4CDA89EDE3BC0BC7F605364B8451",
|
||||
"to": "me",
|
||||
"from": "111111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": [],
|
||||
"timestamp": 1692956972
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_1111111111@c.us_BAE595F4E0A2042C",
|
||||
"to": "111111111@c.us",
|
||||
"from": "me",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
## Webhooks Advanced 
|
||||
### HMAC authentication
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Changelog"
|
||||
description: "WAHA's changelog"
|
||||
lead: "Changelog"
|
||||
lead: "You can find here the list of changes made to WAHA."
|
||||
date: 2020-10-06T08:49:31+00:00
|
||||
lastmod: 2020-10-06T08:49:31+00:00
|
||||
draft: false
|
||||
@@ -12,8 +12,197 @@ menu:
|
||||
weight: 199
|
||||
toc: true
|
||||
---
|
||||
|
||||
If you wish to get and read Release Notes - read them on one of our platforms, **these posts are FREE**.
|
||||
- [**Boosty ->**](https://boosty.to/wa-http-api)
|
||||
- [**Patreon ->**](patreon.com/wa_http_api)
|
||||
|
||||
**Subscribe for FREE to get new updates** there!
|
||||
|
||||
----
|
||||
|
||||
## 2024.5
|
||||
### 🎉 New
|
||||
----
|
||||
|
||||
[Swagger White Label]({{< relref "/docs/how-to/swagger#white-label" >}}) - show your own brand in the Swagger documentation!
|
||||
- Read more about [Swagger White Label]({{< relref "/docs/how-to/swagger#white-label" >}})
|
||||
- Issue: [#305](https://github.com/devlikeapro/whatsapp-http-api/issues/305)
|
||||
- Build: `2024.5.4`
|
||||
- Engine: **ALL**
|
||||
|
||||
----
|
||||
|
||||
### 🐛 Fixes
|
||||
----
|
||||
|
||||
Use local cache for **WEBJS** engine (versions file).
|
||||
- Issue: [#316](https://github.com/devlikeapro/whatsapp-http-api/issues/316)
|
||||
- Build: `2024.5.4`
|
||||
- Engine: **WEBJS**
|
||||
|
||||
----
|
||||
|
||||
Don't allow to start two sessions with the same name.
|
||||
|
||||
Before API allowed to start two sessions with the same name, which could lead to potential problems (no way to stop the first, abandoned session).
|
||||
- Issue: [#315](https://github.com/devlikeapro/whatsapp-http-api/issues/315)
|
||||
- Read more about [start a session](https://waha.devlike.pro/docs/how-to/sessions/#start)
|
||||
- Build: `2024.5.3`
|
||||
- Engine: **ALL**
|
||||
|
||||
----
|
||||
|
||||
## 2024.4
|
||||
### 🎉 New
|
||||
----
|
||||
|
||||
Add **WAHA Dashboard** - UI to manage your WhatsApp sessions!
|
||||
- Read more about [Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}})
|
||||
- Open [screenshot](/images/waha-dashboard.png)
|
||||
|
||||
----
|
||||
|
||||
Add `GET /api/sessions/{session}` endpoint to get information about a specific session.
|
||||
- Read more about [Get session information]({{< relref "/docs/how-to/sessions#get-session" >}})
|
||||
- Issue: [#300](https://github.com/devlikeapro/whatsapp-http-api/issues/300)
|
||||
|
||||
----
|
||||
|
||||
Implement `GET /api/contacts/profile-picture` for **NOWEB** engine.
|
||||
- Read more about [Get contact profile picture](https://waha.devlike.pro/docs/how-to/contacts/#get-contact-profile-picture)
|
||||
- Issue: [#298](https://github.com/devlikeapro/whatsapp-http-api/issues/298)
|
||||
|
||||
----
|
||||
|
||||
## 2024.3
|
||||
### 🎉 New
|
||||
|
||||
----
|
||||
|
||||
Add `message.reaction` webhook in **WEBJS** and **NOWEB** engines
|
||||
- Read more about [message.reaction]({{< relref "/docs/how-to/webhooks#messagereaction" >}}) event
|
||||
- Issue: [#275](https://github.com/devlikeapro/whatsapp-http-api/issues/275)
|
||||
|
||||
👉 **NOWEB** engine note - reactions were sent in `'message'` and `'message.any'` events, not it's available **only** in `'message.reaction'`!
|
||||
|
||||
----
|
||||
|
||||
Add star and unstar message endpoint `PUT /api/star`
|
||||
- Read [Star and unstar message]({{< relref "/docs/how-to/send-messages#star-and-unstar-message" >}}) documentation
|
||||
- Issue: [#273](https://github.com/devlikeapro/whatsapp-http-api/issues/240)
|
||||
|
||||
----
|
||||
|
||||
Add `PUT /api/{session}/chats/{chatId}/messages/{messageId}` endpoint to **edit** the message.
|
||||
- Read more about [Edit message]({{< relref "/docs/how-to/send-messages#edit-message" >}})
|
||||
- Issue: [#241](https://github.com/devlikeapro/whatsapp-http-api/issues/241)
|
||||
|
||||
----
|
||||
|
||||
Add `DELETE /api/{session}/chats/{chatId}/messages/{messageId}` endpoint to **delete** the message.
|
||||
- Read more about [Delete message]({{< relref "/docs/how-to/send-messages#delete-message" >}})
|
||||
- Issue: [#209](https://github.com/devlikeapro/whatsapp-http-api/issues/209)
|
||||
|
||||
----
|
||||
|
||||
Add `POST /api/sendContactVcard` support for **NOWEB** engine.
|
||||
- Read more about [Send Contact vCard]({{< relref "/docs/how-to/send-messages#send-contact-vcard" >}})
|
||||
- Issue: [#276](https://github.com/devlikeapro/whatsapp-http-api/issues/256)
|
||||
|
||||
----
|
||||
|
||||
Handles `caption` and `filename` right in `POST /api/sendFile`
|
||||
- Issue: [#94](https://github.com/devlikeapro/whatsapp-http-api/issues/94)
|
||||
- Issue: [#133](https://github.com/devlikeapro/whatsapp-http-api/issues/133)
|
||||
|
||||
----
|
||||
|
||||
Add security settings for who can send messages `PUT /api/{session}/groups/{groupId}/settings/security/messages-admin-only`
|
||||
- Read [Security - who can send messages]({{< relref "/docs/how-to/groups##security---who-can-send-messages" >}})
|
||||
- Issue: [#274](https://github.com/devlikeapro/whatsapp-http-api/issues/274)
|
||||
|
||||
----
|
||||
|
||||
Add `config.debug` field to `POST /api/session/start` to enable debug and verbose logs for the session.
|
||||
|
||||
----
|
||||
|
||||
### 👉 Breaking changes
|
||||
- **NOWEB** - reactions were sent in `'message'` and `'message.any'` events, not it's available **only** in `'message.reaction'`!
|
||||
- Add **required body** in `PUT /api/{session}/groups/{groupId}/settings/security/info-admin-only` endpoint.
|
||||
```json
|
||||
{
|
||||
"adminsOnly": false
|
||||
}
|
||||
```
|
||||
|
||||
- `POST /api/sendContactVcard` doesn't work in **VENOM** anymore (use **NOWEB** engine).
|
||||
|
||||
## 2024.2
|
||||
- Add support for [MongoDB as storage for Session data]({{< relref "/docs/how-to/storages" >}})
|
||||
- Support persistent file storage for media files - [now you can save media files between container restarts]({{< relref "/docs/how-to/storages#media" >}})
|
||||
- If you set `WHATSAPP_FILES_LIFETIME=0` environment variable - media files will be never deleted.
|
||||
- Add `GET /api/health` endpoint to [check the health of the service](https://waha.devlike.pro/docs/how-to/other/)
|
||||
|
||||
## 2024.1
|
||||
- Implement [Patron Portal](https://portal.devlike.pro/) where you can get your personal API key and manage your perks.
|
||||
- Read more on [Patreon ->](https://www.patreon.com/posts/waha-patron-97637416)
|
||||
- Read more on [Boosty ->](https://boosty.to/wa-http-api/posts/8319079f-dac1-4179-b954-fcc559097c76)
|
||||
|
||||
## 2024.2
|
||||
- Listen for browser disconnected and page close events in **WEBJS** engine [#262](https://github.com/devlikeapro/whatsapp-http-api/issues/262)
|
||||
|
||||
## 2023.12
|
||||
December 2023
|
||||
- Add `chatId` field to `GET /api/contacts/check-exists` to help get the right `chatId` for Brazilian numbers.
|
||||
Read more about
|
||||
[error sending text to half of Brazilian numbers (every number registered before 2012) ->](https://github.com/devlikeapro/whatsapp-http-api/issues/238)
|
||||
|
||||
## 2023.11
|
||||
November 2023
|
||||
- Add different formats for QR code:
|
||||
1. **binary image** - `GET /api/{session}/auth/qr`
|
||||
2. **base64 image** - `GET /api/{session}/auth/qr` and set `Accept: application/json` header
|
||||
3. **raw** - `GET /api/{session}/auth/qr?format=raw`
|
||||
- Add different formats for the screenshot:
|
||||
1. **binary image** - `GET /api/{session}/screenshot`
|
||||
2. **base64 image** - `GET /api/{session}/screenshot` and set `Accept: application/json` header
|
||||
- Add `WHATSAPP_SWAGGER_ENABLED=false` so you can hide Swagger documentation (available only in Plus version). [#185](https://github.com/devlikeapro/whatsapp-http-api/issues/185)
|
||||
- Add dedicated `media` field in webhook payload - now you can know which media is attached to the message.
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"hasMedia": true,
|
||||
"media": {
|
||||
"url": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.pdf",
|
||||
"mimetype": "application/pdf",
|
||||
"filename": "file.pdf"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
- Add `WHATSAPP_DOWNLOAD_MEDIA` environment variable to control media download. Available only in Plus version.
|
||||
- `WHATSAPP_DOWNLOAD_MEDIA=True` - download media
|
||||
- `WHATSAPP_DOWNLOAD_MEDIA=False` - do not download media at all.
|
||||
- Add `filename` field for document (file attachments) - the original filename of the document.
|
||||
- Add `/api/sendVideo` endpoint to **NOWEB** and **WEBJS** engines. Available only in Plus version.
|
||||
- Add security settings for edit group info `GET /api/{session}/groups/{groupId}/settings/security/info-admin-only` - updates the group settings to only allow admins to edit group info (title, description, photo).
|
||||
|
||||
## 2023.10
|
||||
October 2023
|
||||
- Add `session.status` event for all engines! Now you can get the latest session's status immediately after it changes.
|
||||
- Add `message.revoked` event in **WEBJS** engine
|
||||
- Add `me` field in webhook payload - now you can know which number is associated with the session
|
||||
- Add `enviroment` field in webhook payload - now you can know which environment is used for the session
|
||||
|
||||
## 2023.9
|
||||
September 2023
|
||||
- Add `GET /api/sessions/{session/me` endpoint so you [can get the phone number associated with the session](https://waha.devlike.pro/docs/how-to/sessions/#get-me)
|
||||
- Add [polls support in NOWEB engine](https://waha.devlike.pro/docs/how-to/polls)
|
||||
- Add dedicated [Get QR](https://waha.devlike.pro/docs/how-to/sessions/#get-qr) endpoint!
|
||||
- Support [pairing method (NOWEB)](https://waha.devlike.pro/docs/how-to/sessions/#get-pairing-code) - you can connect with a code instead of QR.
|
||||
- Add string field `ackName: DEVICE|READ|...` in [message.ack payload](https://waha.devlike.pro/docs/how-to/webhooks/#messageack)
|
||||
|
||||
@@ -13,27 +13,8 @@ weight: 130
|
||||
toc: true
|
||||
---
|
||||
|
||||
## How to update?
|
||||
|
||||
{{< alert icon="💡" text="Please test all new versions in the development environment before updating production!" />}}
|
||||
|
||||
 For **Core** version the command is
|
||||
|
||||
```bash
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
 For **Plus** version, we use login to get the image before:
|
||||
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
|
||||
Read more about how to get `PASSWORD` for [Plus Version →]({{< relref "plus-version" >}})
|
||||
|
||||
## How much CPU and Memory does WhatsApp HTTP API consume?
|
||||
### WEBJS
|
||||
|
||||
The benchmark has been made on **Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz**.
|
||||
It may differ from case to case, it depends on usage pattern - how many messages you get, how many send, etc.
|
||||
@@ -46,4 +27,12 @@ It may differ from case to case, it depends on usage pattern - how many messages
|
||||
The nature of WhatsApp HTTP API and its underlying engines - is to run **real** WhatsApp Web version in Chrome and
|
||||
communicate with it to prevent blocking from WhatsApp. It's the reason why it's so demanding on resources.
|
||||
|
||||
### NOWEB
|
||||
If you're looking for less resource demanded engine - [have a look at **NOWEB** engine ->]({{< relref "/docs/how-to/engines" >}})
|
||||
|
||||
Quotes from the users:
|
||||
> The server has **2 CPU and 8GB** of memory. Today we have **85 sessions** in this instance.
|
||||
|
||||
> **400** sessions with **4CPU and 32RAM**. It's working fine.
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ When developing a bot for WhatsApp, you **should never initiate a conversation**
|
||||
Instead, your bot **should only reply** to messages that it receives.
|
||||
This will prevent your bot from being flagged as spam by WhatsApp's users and algorithms.
|
||||
|
||||
> You can use a short link http://wa.me/7911111111?text=Hi
|
||||
> so a user can click on it and start the dialog with the bot first
|
||||
|
||||
### 2. Avoid Spamming and Sending Unnecessary Content
|
||||
|
||||
Sending too many messages or sending content that the user did not request can also lead to your bot being blocked. Make
|
||||
@@ -56,3 +59,34 @@ Here's a recommended process to follow:
|
||||
|
||||
By following these steps, you can ensure that your bot processes messages in a way that's compliant with WhatsApp's
|
||||
guidelines and reduces the risk of being blocked.
|
||||
|
||||
## How to not get Banned?
|
||||
|
||||
WhatsApp knows that it's uncommon for someone to send so many messages or bulk messages to people they've never talked to each other before so it is considered spam/marketing junk pretty fast. There are some tips before sending a message to WhatsApp
|
||||
|
||||
**Dos and Don'ts:**
|
||||
|
||||
1. Important: Do NOT send messages which get you a report. As long as you don't get reports from users who you sent a message, your account will be mostly fine.
|
||||
2. Having real content, a survey that the person agreed with is different from a marketing message on a Saturday night.
|
||||
3. Send messages written in different ways, you could make a script that places spacebars randomly on your string AND includes the person's (first) name
|
||||
4. Never use fixed times, always go for sending the first message, wait a random time between 30 ~ and 60 seconds and then send the second message
|
||||
5. Always try to group contacts by their area code, WhatsApp expects a regular person to talk mostly with contacts that are within the same area of your phone number.
|
||||
6. Have a profile picture, this is not related to WhatsApp Bots Catcher® but sending a new message for someone not having a picture/name/status will elevate your chances of being manually tagged as spam.
|
||||
7. Send "seen" confirmation to messages or disable it on WhatsApp
|
||||
8. Avoid sending links that were previously marked as spam on WhatsApp or non-HTTPS. A URL shortener is a good idea
|
||||
9. IMPORTANT: It's terrible if you send messages 24/7 without giving it some time to wait. Random delays between messages are not enough, send a reasonable amount of messages keeping in mind your conversion rate, For example: for one hour send a maximum of 4 messages per contact that have replied to your message, and stop sending messages for one hour, then start again. Again, don't send messages without stopping for a while between every "package"
|
||||
10. Send only one short message when starting a conversation, one should not send long texts or multiple messages without the user consenting
|
||||
|
||||
**Have in mind:**
|
||||
|
||||
1. For every one you send a message that doesn't have your number on their contact list asked if it's spam, being tagged as spam a few times (5 - 10) will get you banned
|
||||
2. WhatsApp records every movement you do, you can even check the logs when sending simple support email, it contains all kinds of information, this said: act as human as possible
|
||||
3. Try to engage in conversations, as long as you send a message and the person doesn't automatically block you it'll be quite okay. People constantly talking to you and adding you to their contact list will make your number stronger against a ban
|
||||
4. Think about that like a points system, you start with zero points (negative if your device was previously blacklisted), if you reach below zero you are out, if you engage in conversations you get a point, if you are tagged as spam you lose some points, if you are blocked you may lose more points
|
||||
5. Finally, If your content is spam, it doesn't matter if you are using a broadcast list, group, or direct contact, you will still be banned
|
||||
|
||||
As API, we say all that's left to do right now is to agree with WhatsApp's policy, not send spam messages, and always wait for the other person to contact you first.
|
||||
|
||||
You could make it by sending an SMS to the person with a link to start a chat on WhatsApp with you by link [https://wa.me/12132132131?text=Hi](https://wa.me/12132132131?text=Hi).
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ toc: true
|
||||
**WAHA** - **W**hats**A**pp **H**TTP **A**PI that you can install on your own server and run in less than 5 minutes!
|
||||
|
||||
<div class="d-flex justify-content-center my-4">
|
||||
<img src="/images/logo.png"/>
|
||||
<img src="/images/logo.svg" style='border-radius: 50%' width='150'/>
|
||||
</div>
|
||||
|
||||
## Get started
|
||||
@@ -25,10 +25,16 @@ toc: true
|
||||
We will guide you through the necessary steps to successfully send your first text message using WhatsApp HTTP API in
|
||||
[**Quick Start →**]({{< relref "quick-start" >}}).
|
||||
|
||||
## Disclaimer
|
||||
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at [whatsapp.com](https://whatsapp.com).
|
||||
|
||||
"WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners. Also it is not guaranteed you will not be blocked by using this method. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.
|
||||
|
||||
For any businesses looking to integrate with WhatsApp for critical applications, we highly recommend using officially supported methods, such as Twilio's solution or other alternatives. You might also consider [the official API ->](https://developers.facebook.com/docs/whatsapp/).
|
||||
|
||||
|
||||
|
||||
## Features
|
||||
WAHA is distributed in two versions:
|
||||
- Core  - the basic version that meet almost 80% people's needs. 100% free and [open source ->](https://github.com/devlikeapro/whatsapp-http-api).
|
||||
- Plus  - the version with advanced messages, security, and reliability features. Donations, no license expiration, quick updates, read more about [Plus Version →]({{< relref "plus-version" >}})
|
||||
|
||||
Here's the available features:
|
||||
|
||||
@@ -37,7 +43,6 @@ Here's the available features:
|
||||
- Receive messages
|
||||
- Message replies
|
||||
- Send location
|
||||
- Send buttons
|
||||
- Receive location
|
||||
- React to messages
|
||||
- Send media (images/documents/files) 
|
||||
@@ -66,7 +71,7 @@ Here's the available features:
|
||||
- Single WhatsApp account running inside one container
|
||||
- Multiple WhatsApp account running inside one container 
|
||||
- Session saving (don't have to scan QR on every restart) 
|
||||
- Session saving on remote storage (database, redis) 
|
||||
- Session saving on remote storage (mongodb) 
|
||||
|
||||
### Security
|
||||
- API authentication 
|
||||
@@ -75,3 +80,12 @@ Here's the available features:
|
||||
### Updates
|
||||
- Bug fixes and updates come as soon as they are implemented.
|
||||
|
||||
## Engines
|
||||
Not all Engines support all Features, see [**the feature supported by engines ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
|
||||
## Versions
|
||||
WAHA is distributed in two versions:
|
||||
- Core  - the basic version that meet almost 80% people's needs. **100% free and [open source ->](https://github.com/devlikeapro/whatsapp-http-api)**.
|
||||
- Plus  - the version with advanced messages, security, and reliability features. Donations, no license expiration, quick updates, read more about [**Plus Version →**]({{< relref "plus-version" >}})
|
||||
|
||||
@@ -9,7 +9,7 @@ images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "overview"
|
||||
weight: 110
|
||||
weight: 101
|
||||
toc: true
|
||||
---
|
||||
|
||||
@@ -29,25 +29,28 @@ When you are ready - come back and follows the below steps to send the first tex
|
||||
Docker makes it easy to ship all-in-one solution with the runtime and dependencies. You don't have to worry about
|
||||
language-specific libraries or chrome installation.
|
||||
|
||||
Also Docker makes installation and update processes so simple, just one command!
|
||||
Also, Docker makes installation and update processes so simple, just one command!
|
||||
{{< /details >}}
|
||||
|
||||
## Send your first message
|
||||
|
||||
We will guide you through the necessary steps to successfully send your first text message using WhatsApp HTTP API.
|
||||
|
||||
**If you find it easier to follow a video** tutorial, we've got you covered!
|
||||
A 3-minute video tutorial is available to help you navigate WhatsApp HTTP API smoothly.
|
||||
<div class='article-card'>
|
||||
<b class='h4'>Are you a visual learner?</b>
|
||||
|
||||
<div class="d-flex justify-content-center my-4">
|
||||
<iframe
|
||||
width="560" height="315"
|
||||
src="https://www.youtube.com/embed/RFerMyAUPRg"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
We've got you covered! Watch the video below to see how to send your first message using <b>WAHA</b>.
|
||||
|
||||
<div class="d-flex justify-content-center my-4">
|
||||
<iframe
|
||||
width="560" height="315"
|
||||
src="https://www.youtube.com/embed/RFerMyAUPRg"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
### 1. Download image
|
||||
@@ -63,7 +66,7 @@ docker pull devlikeapro/whatsapp-http-api
|
||||
 For Plus version, we use login to get the image before:
|
||||
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
@@ -72,7 +75,7 @@ Read more about how to get `PASSWORD` for [Plus Version →]({{< relref "plus-ve
|
||||
|
||||
#### 1.1 Download image on ARM
|
||||
|
||||
If you're using ARM (like Apple Silicon, Apple M1, etc) - use following commands to download the image
|
||||
If you're using ARM (like Apple Silicon, Apple M1, etc.) - use following commands to download the image
|
||||
|
||||
 For Core version the command is
|
||||
```bash
|
||||
@@ -84,12 +87,12 @@ docker tag devlikeapro/whatsapp-http-api:arm devlikeapro/whatsapp-http-api
|
||||
|
||||
 For Plus version the command is:
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus:arm
|
||||
docker logout
|
||||
|
||||
# Rename it, so you can use devlikeapro/whatsapp-http-api image in other place
|
||||
docker tag devlikeapro/whatsapp-http-api-plus:arm devlikeapro/whatsapp-http-api
|
||||
docker tag devlikeapro/whatsapp-http-api-plus:arm devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
### 2. Run WhatsApp HTTP API
|
||||
@@ -107,6 +110,9 @@ Open the link in your browser [http://localhost:3000/](http://localhost:3000/) a
|
||||
(Swagger).
|
||||
|
||||
{{< alert icon="👉" text="We don't recommend expose the API in the internet without authentication!" />}}
|
||||
[Read more about Security ->]({{< relref "/docs/how-to/security" >}})
|
||||
|
||||
<br/>
|
||||
|
||||

|
||||
|
||||
@@ -183,8 +189,9 @@ curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP AP
|
||||
```
|
||||
|
||||
## What is next?
|
||||
- Right now you've sent simple text message, but you can send more! [Send messages →]({{< relref "/docs/how-to/send-messages" >}})
|
||||
- Read how to receive and response to messages [Receive messages →]({{< relref "/docs/how-to/receive-messages" >}})
|
||||
- Learn about the easiest way to manage your WhatsApp sessions - [Dashboard ->]({{< relref "/docs/how-to/waha-dashboard" >}})
|
||||
- Right now you've sent simple text message, but you can send more! [Send messages ->]({{< relref "/docs/how-to/send-messages" >}})
|
||||
- Read how to receive and response to messages [Receive messages ->]({{< relref "/docs/how-to/receive-messages" >}})
|
||||
- [Save session information, so you don't have to scan QR after container restart ->]({{< relref "/docs/how-to/sessions" >}})
|
||||
- Make sure your [API is properly protected ->]({{< relref "/docs/how-to/security" >}})
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title : "WAHA Hub"
|
||||
description: "WAHA Hub"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 300
|
||||
---
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
title: "WAHA Hub"
|
||||
description: "WAHA Hub"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:57+00:00
|
||||
lastmod: 2020-10-06T08:48:57+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
menu:
|
||||
docs:
|
||||
parent: "overview"
|
||||
weight: 301
|
||||
toc: true
|
||||
---
|
||||
|
||||
|
||||
---
|
||||
|
||||
⚠️
|
||||
|
||||
**WAHA Hub** in **DEVELOPMENT** yet...
|
||||
|
||||
Consider using [Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}}) for managing your sessions.
|
||||
|
||||
Subscribe to [**WAHA PRO**]({{< relref "plus-version#pro" >}}) to speed up the development!
|
||||
|
||||
⚠️
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
**WAHA Hub** - central management solution to help your build reliable infrastructure with multiple WAHA servers!
|
||||
|
||||
While [Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}}) is a UI to manage your WhatsApp sessions on
|
||||
**single server**, **WAHA Hub** is a central management server to control and manage **multiple servers** in a single
|
||||
place.
|
||||
|
||||
👉 **WAHA Hub** is available in [**WAHA PRO**]({{< relref "plus-version#pro" >}}) version only.
|
||||
|
||||

|
||||
<div class="text-center">
|
||||
<a href="waha-dashboard.png" target="_blank">See full size image</a>
|
||||
</div>
|
||||
|
||||
## Features
|
||||
|
||||
- Control and manage multiple servers in a single Hub.
|
||||
- Monitor the status of your servers
|
||||
- And more!
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 73 KiB |
@@ -1,93 +1,264 @@
|
||||
{{ define "main" }}
|
||||
<section class="section container-fluid mt-n3 pb-3">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-12 text-center">
|
||||
<h1 class="mt-0">{{ .Title }}</h1>
|
||||
<section class='section container-fluid mt-n3 pb-3'>
|
||||
<div class='row justify-content-center'>
|
||||
<div class='col-lg-12 text-center'>
|
||||
<h1 class='mt-0'>{{ .Title }}</h1>
|
||||
</div>
|
||||
<div class="col-lg-9 col-xl-9 text-center">
|
||||
<div class="mb-4">
|
||||
<img src="/images/logo.png" title="WhatsApp HTTP API" alt="logo" width="100"/>
|
||||
<div class='col-lg-9 col-xl-9 text-center'>
|
||||
<div class='mb-4'>
|
||||
<img src='/images/logo.svg' title='WhatsApp HTTP API' alt='logo' style='border-radius: 50%; width: 10rem' />
|
||||
</div>
|
||||
<p class="lead">{{ .Params.lead | safeHTML }}</p>
|
||||
<code>
|
||||
docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api
|
||||
</code>
|
||||
<br/>
|
||||
<br/>
|
||||
<a class="btn btn-primary btn-lg px-4 mb-2"
|
||||
href="/docs/{{ if .Site.Params.options.docsVersioning }}{{ .Site.Params.docsVersion }}/{{ end }}overview/introduction/"
|
||||
role="button">Get Started</a>
|
||||
<p class="meta"><a href="https://github.com/devlikeapro/whatsapp-http-api">Source code in GitHub.</a></p>
|
||||
<p class='lead'>{{ .Params.lead | safeHTML }}</p>
|
||||
<div class='code-block highlight'>
|
||||
<pre tabindex='0' class='chroma'><code class='language-bash' data-lang='bash' style='padding: 0'>docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api</code></pre>
|
||||
</div>
|
||||
<a class='btn btn-primary btn-lg px-4 mb-2'
|
||||
href='/docs/{{ if .Site.Params.options.docsVersioning }}{{ .Site.Params.docsVersion }}/{{ end }}overview/introduction/'
|
||||
role='button'>Get Started</a>
|
||||
<p class='meta'><a href='https://github.com/devlikeapro/whatsapp-http-api'>Source code in GitHub.</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ define "sidebar-prefooter" }}
|
||||
<section class="section section-sm">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">It's free!</h2>
|
||||
<section class='section section-sm'>
|
||||
<div class='container hr'>
|
||||
<div class='row justify-content-center text-center'>
|
||||
<div class='col-12'>
|
||||
<h2>
|
||||
WAHA Features
|
||||
</h2>
|
||||
</div>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/message-green.png' alt='Free' style='width: 5rem'>
|
||||
<h2 class='h4 color-accent'>Send and Receive<br />Messages</h2>
|
||||
<p>
|
||||
<b>WAHA Core</b> version is always free!
|
||||
You can
|
||||
<a href='/docs/how-to/send-messages/'>send messages to</a>
|
||||
and
|
||||
<a href='/docs/how-to/receive-messages/'>receive messages from</a>
|
||||
WhatsApp using HTTP API (REST API).
|
||||
</p>
|
||||
|
||||
<div class='code-block highlight' style='text-align: left'>
|
||||
<pre tabindex='0' class='chroma m-0'>
|
||||
<code class='language-json' data-lang='json' style='padding: 1rem!important; border-radius: 0.5rem'>POST /api/sendText
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "12132132130@c.us",
|
||||
"text": "Hi there!"
|
||||
}
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/file-check-green.svg' alt='Servers' style='width: 5rem'>
|
||||
<h2 class='h4'>Send and Receive<br />Files</h2>
|
||||
<p>
|
||||
You can
|
||||
<a href='/docs/how-to/send-messages/'>send files to</a>
|
||||
and
|
||||
<a href='/docs/how-to/receive-messages/'>receive files from</a>
|
||||
WhatsApp using HTTP API (REST API).
|
||||
</p>
|
||||
|
||||
<div class='code-block highlight' style='text-align: left'>
|
||||
<pre tabindex='0' class='chroma m-0'>
|
||||
<code class='language-json' data-lang='json' style='padding: 1rem!important; border-radius: 0.5rem'>POST /api/sendFile
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "12132132130@c.us",
|
||||
"file": {
|
||||
"url": "https://d.com/invoice.pdf"
|
||||
}
|
||||
}</code>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/button-green.png' alt='API' style='width: 5rem'>
|
||||
<h2 class='h4'>
|
||||
WAHA can do<br />a lot more
|
||||
</h2>
|
||||
<p>
|
||||
Check out
|
||||
<a href='/docs/overview/introduction/#features'>
|
||||
the documentation
|
||||
</a>
|
||||
to see all the features.
|
||||
</p>
|
||||
|
||||
<div class='code-block highlight' style='text-align: left'>
|
||||
<pre tabindex='0' class='chroma m-0'>
|
||||
<code class='language-json' data-lang='json' style='padding: 1rem!important; border-radius: 0.5rem'>POST /api/{session}/groups
|
||||
{
|
||||
"name": "Group name",
|
||||
"participants": [
|
||||
{"id": "123123123123@c.us"}
|
||||
]
|
||||
}
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-12 pros-card' style='width: 80%'>
|
||||
<h2 class='h4 color-accent'>Swagger documentation and OpenAPI Specification!</h2>
|
||||
<p>
|
||||
<a href='/docs/how-to/plus-version/#core' target='_blank'>
|
||||
<b>WAHA Core</b>
|
||||
</a>
|
||||
and
|
||||
<a href='/docs/how-to/plus-version/#plus' target='_blank'>
|
||||
<b>WAHA Plus</b>
|
||||
</a>
|
||||
provide
|
||||
<a href='/docs/how-to/swagger/' target='_blank'>
|
||||
Swagger documentation and OpenApi schema.
|
||||
</a>
|
||||
<br>
|
||||
Even <b>WAHA Plus</b> version have no licence expiration!
|
||||
</p>
|
||||
<video autoplay loop muted playsinline controls='noremoteplayback' width="100%" poster='/images/swagger.png'>
|
||||
<source src="/videos/swagger-overview.webm" type="video/webm" />
|
||||
Download the <a href="/videos/swagger-overview.webm">Swagger Overview video</a> .
|
||||
</video>
|
||||
</div>
|
||||
|
||||
<div class='col-12 pros-card' style='width: 80%'>
|
||||
<h2 class='h4 color-accent'>Built-in Dashboard</h2>
|
||||
<p>
|
||||
<a href='/docs/how-to/plus-version/#plus' target='_blank'>
|
||||
<b>WAHA Plus</b>
|
||||
</a>
|
||||
provides
|
||||
<a href='/docs/how-to/waha-dashboard' target='_blank'>
|
||||
Dashboard
|
||||
</a> - a web interface to easily manage your WhatsApp sessions!
|
||||
<br>
|
||||
</p>
|
||||
<video autoplay loop muted playsinline controls='noremoteplayback' width="100%" poster='/images/waha-dashboard.png'>
|
||||
<source src="/videos/waha-dashboard-overview.webm" type="video/webm" />
|
||||
Download the <a href="/videos/waha-dashboard-overview.webm">Dashboard Overview video</a> .
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class='section section-sm'>
|
||||
<div class='container hr'>
|
||||
<div class='row justify-content-center text-center'>
|
||||
<div class='col-12'>
|
||||
<h2>
|
||||
Why WAHA?
|
||||
</h2>
|
||||
</div>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/free-green.png' alt='Free' style='width: 5rem'>
|
||||
<h2 class='h4 color-accent'>It's free!</h2>
|
||||
<p>
|
||||
<a href='/docs/how-to/plus-version/#tiers' target='_blank'>
|
||||
<b>WAHA Core</b>
|
||||
</a>
|
||||
version is always free, <b>no limits in messages</b> or time!
|
||||
<br>
|
||||
<a href='/docs/how-to/plus-version/#tiers' target='_blank'>
|
||||
<b>WAHA Plus</b>
|
||||
</a>
|
||||
version have no licence expiration!
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Language agnostic</h2>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/servers-green.png' alt='Servers' style='width: 5rem'>
|
||||
<h2 class='h4'>Self-hosted solution</h2>
|
||||
<p>
|
||||
<a href='/docs/how-to/plus-version/#why-waha' target='_blank'>
|
||||
No strings to suspicious SaaS WhatsApp HTTP API solutions.
|
||||
</a>
|
||||
Install it on your own server!
|
||||
</p>
|
||||
</div>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/api-green.png' alt='API' style='width: 5rem'>
|
||||
<h2 class='h4'>HTTP / REST API</h2>
|
||||
<p>
|
||||
Use your own favorite language - Python, JavaScript, PHP, C#, Clojure, or PowerShell.
|
||||
<br/>
|
||||
<small class="text-muted">
|
||||
<br />
|
||||
<small class='text-muted'>
|
||||
PowerShell, really? Are you insane?! Choose another language, dude.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Well documented</h2>
|
||||
<p>Documentation has a lof examples and how-to guides.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Self hosted</h2>
|
||||
<div class='row justify-content-center text-center'>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/document-green.png' alt='Document' style='width: 5rem'>
|
||||
<h2 class='h4'>Well documented</h2>
|
||||
<p>
|
||||
No strings to suspicious SaaS WhatsApp HTTP API solutions. Install it on your own server!
|
||||
</p>
|
||||
<a href='/docs/overview/introduction/' target='_blank'>
|
||||
Documentation
|
||||
</a>
|
||||
has a lof examples and how-to guides.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Easy installation</h2>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/easy-green.png' alt='Easy' style='width: 5rem'>
|
||||
<h2 class='h4'>Quick installation</h2>
|
||||
<p>
|
||||
You need to install <a href="https://docs.docker.com/engine/install/">Docker</a> and can run the API in a
|
||||
click!
|
||||
<br/>
|
||||
<small class="text-muted">
|
||||
You need to install Docker and
|
||||
<a href='/docs/how-to/install/' target='_blank'>
|
||||
run the API in a click!
|
||||
</a>
|
||||
<br />
|
||||
<small class='text-muted'>
|
||||
It's actually "a command", not a click.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">No blocking</h2>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/checked-green.png' alt='Checked' style='width: 5rem'>
|
||||
<h2 class='h4'>No blocking</h2>
|
||||
<p>
|
||||
Under the hood it runs a real instance of Whatsapp Web to avoid getting blocked.
|
||||
<br/>
|
||||
<small class="text-muted">
|
||||
<a href='/docs/how-to/engines/' target='_blank'>
|
||||
Under the hood
|
||||
</a>
|
||||
it runs a real instance of Whatsapp Web to avoid getting blocked.
|
||||
<br />
|
||||
<small class='text-muted'>
|
||||
WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered
|
||||
totally safe.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class='section section-sm'>
|
||||
<div class='container hr'>
|
||||
<div class='text-center mt-4'>
|
||||
<h2>
|
||||
Give it a try!
|
||||
</h2>
|
||||
<div class='mb-4'>
|
||||
<img src='/images/logo.svg' title='WhatsApp HTTP API' alt='logo' style='border-radius: 50%; width: 10rem' />
|
||||
</div>
|
||||
<a class='btn btn-primary btn-lg px-4 mb-2'
|
||||
href='/docs/{{ if .Site.Params.options.docsVersioning }}{{ .Site.Params.docsVersion }}/{{ end }}overview/introduction/'
|
||||
role='button'>Get Started</a>
|
||||
<p class='meta'><a href='https://github.com/devlikeapro/whatsapp-http-api'>Source code in GitHub.</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ define "sidebar-footer" }}
|
||||
<section class="section section-sm container-fluid">
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-9">
|
||||
<section class='section section-sm container-fluid'>
|
||||
<div class='row justify-content-center text-center'>
|
||||
<div class='col-lg-9'>
|
||||
{{- .Content -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,17 +1,63 @@
|
||||
<!-- Yandex.Metrika counter -->
|
||||
<script type="text/javascript" >
|
||||
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
||||
m[i].l=1*new Date();
|
||||
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
||||
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
||||
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
||||
<script type='text/javascript'>
|
||||
(function(m, e, t, r, i, k, a) {
|
||||
m[i] = m[i] || function() {
|
||||
(m[i].a = m[i].a || []).push(arguments);
|
||||
};
|
||||
m[i].l = 1 * new Date();
|
||||
for (var j = 0; j < document.scripts.length; j++) {
|
||||
if (document.scripts[j].src === r) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
k = e.createElement(t), a = e.getElementsByTagName(t)[0], k.async = 1, k.src = r, a.parentNode.insertBefore(k, a);
|
||||
})
|
||||
(window, document, 'script', 'https://mc.yandex.ru/metrika/tag.js', 'ym');
|
||||
|
||||
ym(91185978, "init", {
|
||||
clickmap:true,
|
||||
trackLinks:true,
|
||||
accurateTrackBounce:true,
|
||||
webvisor:true
|
||||
});
|
||||
ym(91185978, 'init', {
|
||||
clickmap: true,
|
||||
trackLinks: true,
|
||||
accurateTrackBounce: true,
|
||||
webvisor: true,
|
||||
});
|
||||
</script>
|
||||
<noscript><div><img src="https://mc.yandex.ru/watch/91185978" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||
<noscript>
|
||||
<div><img src='https://mc.yandex.ru/watch/91185978' style='position:absolute; left:-9999px;' alt='' /></div>
|
||||
</noscript>
|
||||
<!-- /Yandex.Metrika counter -->
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2XLLXRJ1KF"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-2XLLXRJ1KF');
|
||||
</script>
|
||||
<!-- /Google tag (gtag.js) -->
|
||||
|
||||
<!-- Main page cards -->
|
||||
<style>
|
||||
.pros-card {
|
||||
border: 1px solid #e9ecef;
|
||||
border-radius: 0.5rem;
|
||||
padding: 1.5rem;
|
||||
margin: 1rem;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.article-card {
|
||||
border: 1px solid #e9ecef;
|
||||
border-radius: 0.5rem;
|
||||
padding: 1.5rem;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 1rem 0 #4aae2050;
|
||||
}
|
||||
|
||||
.hr {
|
||||
border-top: 1px solid #e9ecef;
|
||||
}
|
||||
</style>
|
||||
<!-- /Main page cards -->
|
||||
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,289 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Dashboard | WAHA</title>
|
||||
<link rel="icon" href="./favicon.ico" />
|
||||
<style>
|
||||
:root {
|
||||
--surface-card: #1f2937;
|
||||
--surface-border: #374151;
|
||||
--card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
body,
|
||||
html {
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.bg-image {
|
||||
/* The image used */
|
||||
background-image: url('./waha-dashboard.png');
|
||||
|
||||
/* Add the blur effect */
|
||||
filter: blur(2px);
|
||||
-webkit-filter: blur(2px);
|
||||
|
||||
/* Full height */
|
||||
height: 100%;
|
||||
|
||||
/* Center and scale the image nicely */
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #111827;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
}
|
||||
|
||||
svg {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.message {
|
||||
font-size: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgb(158, 158, 255);
|
||||
text-decoration-color: rgb(158, 158, 255);
|
||||
}
|
||||
|
||||
.upgrade-link {
|
||||
text-decoration: none;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.link-button {
|
||||
background-color: #4ade80;
|
||||
padding: 10px 20px;
|
||||
border-radius: 5px;
|
||||
color: #052e16;
|
||||
text-decoration: none;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.card {
|
||||
min-width: 25rem;
|
||||
background: var(--surface-card);
|
||||
border: 1px solid var(--surface-border);
|
||||
box-shadow: var(--card-shadow);
|
||||
padding: 2rem;
|
||||
border-radius: 12px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 2;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="bg-image"></div>
|
||||
<div class="card">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
width="1080"
|
||||
height="1080"
|
||||
viewBox="0 0 1080 1080"
|
||||
xml:space="preserve"
|
||||
>
|
||||
<desc>Created with Fabric.js 5.2.4</desc>
|
||||
<defs></defs>
|
||||
<g
|
||||
transform="matrix(1 0 0 1 540 540)"
|
||||
id="c3cb5d1b-8350-492a-8567-8c1ee2307b9a"
|
||||
></g>
|
||||
<g
|
||||
transform="matrix(1 0 0 1 540 540)"
|
||||
id="054ae9ae-db12-4435-8648-8bfb02267690"
|
||||
>
|
||||
<rect
|
||||
style="
|
||||
stroke: none;
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: none;
|
||||
stroke-linecap: butt;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-linejoin: miter;
|
||||
stroke-miterlimit: 4;
|
||||
fill: rgb(255, 255, 255);
|
||||
fill-rule: nonzero;
|
||||
opacity: 1;
|
||||
visibility: hidden;
|
||||
"
|
||||
vector-effect="non-scaling-stroke"
|
||||
x="-540"
|
||||
y="-540"
|
||||
rx="0"
|
||||
ry="0"
|
||||
width="1080"
|
||||
height="1080"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(1 0 0 1 540 540)">
|
||||
<rect
|
||||
style="
|
||||
stroke: none;
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: none;
|
||||
stroke-linecap: butt;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-linejoin: miter;
|
||||
stroke-miterlimit: 4;
|
||||
fill: rgb(255, 255, 255);
|
||||
fill-rule: nonzero;
|
||||
opacity: 1;
|
||||
visibility: hidden;
|
||||
"
|
||||
vector-effect="non-scaling-stroke"
|
||||
x="-540"
|
||||
y="-540"
|
||||
rx="0"
|
||||
ry="0"
|
||||
width="1080"
|
||||
height="1080"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(2.02 0 0 2.02 540 540)">
|
||||
<rect
|
||||
style="
|
||||
stroke: none;
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: none;
|
||||
stroke-linecap: butt;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-linejoin: miter;
|
||||
stroke-miterlimit: 4;
|
||||
fill: rgb(255, 255, 255);
|
||||
fill-rule: nonzero;
|
||||
opacity: 1;
|
||||
visibility: hidden;
|
||||
"
|
||||
vector-effect="non-scaling-stroke"
|
||||
x="-540"
|
||||
y="-540"
|
||||
rx="0"
|
||||
ry="0"
|
||||
width="1080"
|
||||
height="1080"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(3.68 0 0 3.68 540.38 540.48)">
|
||||
<path
|
||||
style="
|
||||
stroke: none;
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: none;
|
||||
stroke-linecap: butt;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-linejoin: miter;
|
||||
stroke-miterlimit: 4;
|
||||
fill: rgb(74, 173, 32);
|
||||
fill-rule: nonzero;
|
||||
opacity: 1;
|
||||
"
|
||||
vector-effect="non-scaling-stroke"
|
||||
transform=" translate(-392.21, -570.16)"
|
||||
d="M 392.26 705.96 C 376.77 705.96 361.28999999999996 706.0400000000001 345.8 705.95 C 318.16 705.7900000000001 297.6 685.2700000000001 297.22 657.57 C 297.15000000000003 652.24 297.07000000000005 646.9100000000001 297.25 641.59 C 297.36 638.23 296.3 636.6 292.72 636.89 C 290.24 637.09 287.73 636.98 285.23 636.9 C 277.1 636.63 271.70000000000005 631.65 271.38 623.49 C 271.06 615.1800000000001 271.06 606.83 271.37 598.52 C 271.69 590.05 277.04 585.23 285.58 585.01 C 297.21 584.72 297.19 584.72 297.21999999999997 573.01 C 297.22999999999996 567.36 297.14 561.72 297.97999999999996 556.0699999999999 C 301.25999999999993 533.93 320.72999999999996 516.4599999999999 343.09 516.04 C 355.07 515.81 367.07 515.86 379.04999999999995 516.02 C 382.72999999999996 516.0699999999999 384.02 514.87 383.96 511.15 C 383.77 500.65999999999997 383.76 490.16999999999996 383.96999999999997 479.67999999999995 C 384.04999999999995 476.00999999999993 382.96 473.65999999999997 379.92999999999995 471.37999999999994 C 372.23999999999995 465.5799999999999 369.78 456.25999999999993 373.06999999999994 447.7199999999999 C 376.18999999999994 439.5999999999999 385.13999999999993 433.7399999999999 393.4599999999999 434.3599999999999 C 402.63999999999993 435.0399999999999 410.43999999999994 441.3499999999999 412.4599999999999 450.2199999999999 C 414.4799999999999 459.0299999999999 411.7099999999999 466.4299999999999 404.4699999999999 471.7899999999999 C 401.8699999999999 473.7199999999999 400.9199999999999 475.69999999999993 400.9699999999999 478.8299999999999 C 401.1199999999999 489.1499999999999 401.2499999999999 499.4799999999999 400.9299999999999 509.79999999999995 C 400.7899999999999 514.5 402.0299999999999 516.24 406.9999999999999 516.0799999999999 C 417.8099999999999 515.7299999999999 428.6399999999999 515.91 439.4699999999999 515.9899999999999 C 466.5199999999999 516.2099999999999 486.7199999999999 536.2299999999999 487.2399999999999 563.3 C 487.3399999999999 568.29 487.2599999999999 573.29 487.2799999999999 578.29 C 487.2999999999999 585 487.3099999999999 585 493.7899999999999 585.02 C 495.94999999999993 585.03 498.1199999999999 584.96 500.2799999999999 585.06 C 507.94999999999993 585.43 512.9999999999999 590.42 513.1499999999999 598.1199999999999 C 513.3199999999998 606.6099999999999 513.3099999999998 615.1099999999999 513.1599999999999 623.5999999999999 C 513.0299999999999 631.3599999999999 508.1999999999999 636.31 500.47999999999985 636.8699999999999 C 498.15999999999985 637.0399999999998 495.77999999999986 637.2199999999999 493.49999999999983 636.8899999999999 C 488.1999999999998 636.1299999999999 486.86999999999983 638.5399999999998 487.1999999999998 643.3999999999999 C 487.54999999999984 648.5399999999998 487.3499999999998 653.7199999999999 487.23999999999984 658.8799999999999 C 486.67999999999984 685.6599999999999 466.4599999999998 705.7399999999999 439.71999999999986 705.9599999999999 C 423.9 706.06 408.08 705.95 392.26 705.96 z"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(-3.68 0 0 -3.68 546.38 845.01)">
|
||||
<path
|
||||
style="
|
||||
stroke: none;
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: none;
|
||||
stroke-linecap: butt;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-linejoin: miter;
|
||||
stroke-miterlimit: 4;
|
||||
fill: rgb(56, 134, 22);
|
||||
fill-rule: nonzero;
|
||||
opacity: 1;
|
||||
"
|
||||
vector-effect="non-scaling-stroke"
|
||||
transform=" translate(-394.07, -654.42)"
|
||||
d="M 394.26 632.93 C 404.75 632.93 415.23 632.9 425.71999999999997 632.9399999999999 C 431.92999999999995 632.9599999999999 433.52 634.7399999999999 432.90999999999997 640.7099999999999 C 430.99999999999994 659.66 414.40999999999997 675.2199999999999 395.38 675.91 C 376.87 676.5799999999999 359.57 662.65 356 644.1899999999999 C 355.72 642.7199999999999 355.33 641.26 355.19 639.78 C 354.71 634.9 356.32 633.01 361.3 632.97 C 372.29 632.87 383.28 632.93 394.26 632.93 z"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(3.68 0 0 3.68 673.99 594.08)">
|
||||
<path
|
||||
style="
|
||||
stroke: none;
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: none;
|
||||
stroke-linecap: butt;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-linejoin: miter;
|
||||
stroke-miterlimit: 4;
|
||||
fill: rgb(56, 135, 22);
|
||||
fill-rule: nonzero;
|
||||
opacity: 1;
|
||||
"
|
||||
vector-effect="non-scaling-stroke"
|
||||
transform=" translate(-428.75, -584.99)"
|
||||
d="M 428.83 602 C 419.12 601.96 411.59999999999997 594.6 411.53 585.07 C 411.46999999999997 575.4100000000001 419.21 567.9100000000001 429.16999999999996 567.98 C 438.33 568.0500000000001 445.93999999999994 575.71 445.97999999999996 584.91 C 446.02 594.33 438.29 602.04 428.83 602 z"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
</g>
|
||||
<g transform="matrix(3.68 0 0 3.68 406.92 594.18)">
|
||||
<path
|
||||
style="
|
||||
stroke: none;
|
||||
stroke-width: 1;
|
||||
stroke-dasharray: none;
|
||||
stroke-linecap: butt;
|
||||
stroke-dashoffset: 0;
|
||||
stroke-linejoin: miter;
|
||||
stroke-miterlimit: 4;
|
||||
fill: rgb(56, 135, 22);
|
||||
fill-rule: nonzero;
|
||||
opacity: 1;
|
||||
"
|
||||
vector-effect="non-scaling-stroke"
|
||||
transform=" translate(-356.06, -584.99)"
|
||||
d="M 339.05 584.57 C 339.19 574.94 346.67 567.84 356.53000000000003 567.99 C 366.26000000000005 568.14 373.21000000000004 575.46 373.07000000000005 585.42 C 372.94000000000005 595.16 365.62000000000006 602.13 355.68000000000006 602 C 346.04 601.87 338.91 594.4 339.05 584.57 z"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<div class="message">
|
||||
Sorry,
|
||||
<a
|
||||
href="https://waha.devlike.pro/docs/how-to/waha-dashboard"
|
||||
target="_blank"
|
||||
>Dashboard</a
|
||||
>
|
||||
is not available in <strong>WAHA Core</strong> version.
|
||||
<br />
|
||||
Please consider upgrading to <strong>WAHA Plus</strong>.
|
||||
</div>
|
||||
<div style="margin-top: 2rem; margin-bottom: 1rem">
|
||||
<a
|
||||
class="upgrade-link link-button"
|
||||
href="https://waha.devlike.pro/docs/how-to/plus-version/"
|
||||
target="_blank"
|
||||
>Upgrade to WAHA Plus</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 646 B After Width: | Height: | Size: 807 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 36 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M15 19L17 21L21 17M13 3H8.2C7.0799 3 6.51984 3 6.09202 3.21799C5.71569 3.40973 5.40973 3.71569 5.21799 4.09202C5 4.51984 5 5.0799 5 6.2V17.8C5 18.9201 5 19.4802 5.21799 19.908C5.40973 20.2843 5.71569 20.5903 6.09202 20.782C6.51984 21 7.0799 21 8.2 21H11.5M13 3L19 9M13 3V7.4C13 7.96005 13 8.24008 13.109 8.45399C13.2049 8.64215 13.3578 8.79513 13.546 8.89101C13.7599 9 14.0399 9 14.6 9H19M19 9V13.4M9 17H11.5M9 13H15M9 9H10" stroke="#388716" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 747 B |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15 19L17 21L21 17M13 3H8.2C7.0799 3 6.51984 3 6.09202 3.21799C5.71569 3.40973 5.40973 3.71569 5.21799 4.09202C5 4.51984 5 5.0799 5 6.2V17.8C5 18.9201 5 19.4802 5.21799 19.908C5.40973 20.2843 5.71569 20.5903 6.09202 20.782C6.51984 21 7.0799 21 8.2 21H11.5M13 3L19 9M13 3V7.4C13 7.96005 13 8.24008 13.109 8.45399C13.2049 8.64215 13.3578 8.79513 13.546 8.89101C13.7599 9 14.0399 9 14.6 9H19M19 9V13.4M9 17H11.5M9 13H15M9 9H10" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 744 B |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 84 KiB |
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 27.8.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Слой_1"
|
||||
width="1000"
|
||||
height="1000"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="230 260 500 550"
|
||||
style="background-color: #94DB77" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#94DB77;}
|
||||
.st1{fill:#4AAD20;}
|
||||
.st2{fill:#388616;}
|
||||
.st3{fill:#388716;}
|
||||
.st4{fill:#E9F3E4;}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0" d="M191.12,540.08c0-91.78,0.03-183.55-0.1-275.33c0-3.5,0.49-4.75,5.66-4.75
|
||||
c187.59,0.13,375.17,0.13,562.76,0.02c4.6,0,5.54,0.74,5.54,4.34c-0.14,183.72-0.14,367.44,0.02,551.16c0,4-1.5,4.47-6.02,4.47
|
||||
c-187.38-0.09-374.75-0.1-562.13,0.01c-4.78,0-5.86-0.84-5.86-4.59C191.15,723.63,191.12,631.86,191.12,540.08z"/>
|
||||
<path class="st1" d="M392.26,705.96c-15.49,0-30.97,0.08-46.46-0.01c-27.64-0.16-48.2-20.68-48.58-48.38
|
||||
c-0.07-5.33-0.15-10.66,0.03-15.98c0.11-3.36-0.95-4.99-4.53-4.7c-2.48,0.2-4.99,0.09-7.49,0.01c-8.13-0.27-13.53-5.25-13.85-13.41
|
||||
c-0.32-8.31-0.32-16.66-0.01-24.97c0.32-8.47,5.67-13.29,14.21-13.51c11.63-0.29,11.61-0.29,11.64-12
|
||||
c0.01-5.65-0.08-11.29,0.76-16.94c3.28-22.14,22.75-39.61,45.11-40.03c11.98-0.23,23.98-0.18,35.96-0.02
|
||||
c3.68,0.05,4.97-1.15,4.91-4.87c-0.19-10.49-0.2-20.98,0.01-31.47c0.08-3.67-1.01-6.02-4.04-8.3c-7.69-5.8-10.15-15.12-6.86-23.66
|
||||
c3.12-8.12,12.07-13.98,20.39-13.36c9.18,0.68,16.98,6.99,19,15.86c2.02,8.81-0.75,16.21-7.99,21.57c-2.6,1.93-3.55,3.91-3.5,7.04
|
||||
c0.15,10.32,0.28,20.65-0.04,30.97c-0.14,4.7,1.1,6.44,6.07,6.28c10.81-0.35,21.64-0.17,32.47-0.09
|
||||
c27.05,0.22,47.25,20.24,47.77,47.31c0.1,4.99,0.02,9.99,0.04,14.99c0.02,6.71,0.03,6.71,6.51,6.73c2.16,0.01,4.33-0.06,6.49,0.04
|
||||
c7.67,0.37,12.72,5.36,12.87,13.06c0.17,8.49,0.16,16.99,0.01,25.48c-0.13,7.76-4.96,12.71-12.68,13.27
|
||||
c-2.32,0.17-4.7,0.35-6.98,0.02c-5.3-0.76-6.63,1.65-6.3,6.51c0.35,5.14,0.15,10.32,0.04,15.48
|
||||
c-0.56,26.78-20.78,46.86-47.52,47.08C423.9,706.06,408.08,705.95,392.26,705.96z"/>
|
||||
<path class="st1" d="M598.2,362.07c59.99,0.04,108.7,48.78,108.71,108.8c0.01,60.11-49.08,109.12-109.16,108.98
|
||||
C538.06,579.71,489,530.4,489.14,470.66C489.28,410.82,538.28,362.04,598.2,362.07z"/>
|
||||
<path class="st2" d="M394.26,632.93c10.49,0,20.97-0.03,31.46,0.01c6.21,0.02,7.8,1.8,7.19,7.77c-1.91,18.95-18.5,34.51-37.53,35.2
|
||||
c-18.51,0.67-35.81-13.26-39.38-31.72c-0.28-1.47-0.67-2.93-0.81-4.41c-0.48-4.88,1.13-6.77,6.11-6.81
|
||||
C372.29,632.87,383.28,632.93,394.26,632.93z"/>
|
||||
<path class="st3" d="M428.83,602c-9.71-0.04-17.23-7.4-17.3-16.93c-0.06-9.66,7.68-17.16,17.64-17.09
|
||||
c9.16,0.07,16.77,7.73,16.81,16.93C446.02,594.33,438.29,602.04,428.83,602z"/>
|
||||
<path class="st3" d="M339.05,584.57c0.14-9.63,7.62-16.73,17.48-16.58c9.73,0.15,16.68,7.47,16.54,17.43
|
||||
c-0.13,9.74-7.45,16.71-17.39,16.58C346.04,601.87,338.91,594.4,339.05,584.57z"/>
|
||||
<path class="st4" d="M598.39,405.96c35.8-0.01,64.91,29.38,64.43,65.03c-0.49,35.73-30.23,64.62-65.81,63.8
|
||||
c-8.91-0.21-17.55-2.04-25.56-6.01c-2.93-1.46-5.49-1.58-8.53-0.72c-8.48,2.4-17.03,4.53-25.54,6.84
|
||||
c-2.86,0.78-3.98,0.46-2.97-2.94c2.37-7.97,4.29-16.07,6.69-24.03c1.07-3.56,0.85-6.48-0.81-9.95
|
||||
C519.91,455.33,551.14,405.98,598.39,405.96z"/>
|
||||
<path class="st1" d="M548.99,520.52c1.54-5.81,2.66-10.77,4.2-15.6c0.89-2.79,0.54-4.93-0.91-7.47
|
||||
c-18.93-33.1,0.22-73.52,37.83-80.02c28.33-4.9,56.38,15.3,60.95,43.88c4.74,29.61-15.08,57.38-43.86,61.82
|
||||
c-12.32,1.9-23.85,0-34.68-6c-2.55-1.41-4.83-1.63-7.54-0.84C559.94,517.75,554.84,518.98,548.99,520.52z"/>
|
||||
<path class="st4" d="M615.43,501.21c-7.36-0.22-13.98-3.02-20.17-6.59c-11.52-6.64-20.22-16.22-26.57-27.83
|
||||
c-4.58-8.38-3.88-16.68,1.39-22.88c4.54-5.35,10.44-4.55,13.13,1.78c0.85,1.99,1.52,4.08,2.57,5.95c2.35,4.2,2.04,7.87-1.68,11.1
|
||||
c-2.2,1.92-1.79,3.85-0.29,6.12c4.63,6.96,10.62,12.24,18.05,16.08c3.6,1.86,6.4,1.78,8.35-1.92c2.73-5.2,6.35-5.45,10.9-2.5
|
||||
c1.38,0.9,2.97,1.49,4.46,2.22c6.33,3.1,7.13,9.14,1.71,13.92C623.96,499.62,620.04,501.38,615.43,501.21z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 73 KiB |
@@ -0,0 +1,16 @@
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: #fafafa;
|
||||
}
|
||||
@@ -1,57 +1,19 @@
|
||||
<!-- HTML for static distribution bundle build -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>WAHA - WhatsApp HTTP API</title>
|
||||
<link href="./swagger-ui.css" rel="stylesheet" type="text/css">
|
||||
<link href="./favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/>
|
||||
<link href="./favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/>
|
||||
<style>
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
<title>WAHA | Swagger UI</title>
|
||||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="index.css" />
|
||||
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
|
||||
</head>
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: #fafafa;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
|
||||
<script charset="UTF-8" src="./swagger-ui-bundle.js"></script>
|
||||
<script charset="UTF-8" src="./swagger-ui-standalone-preset.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
// Begin Swagger UI call region
|
||||
const ui = SwaggerUIBundle({
|
||||
url: "openapi.json",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
})
|
||||
// End Swagger UI call region
|
||||
|
||||
window.ui = ui
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,45 +4,41 @@
|
||||
<title>Swagger UI: OAuth2 Redirect</title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
function run() {
|
||||
function run () {
|
||||
var oauth2 = window.opener.swaggerUIRedirectOauth2;
|
||||
var sentState = oauth2.state;
|
||||
var redirectUrl = oauth2.redirectUrl;
|
||||
var isValid, qp, arr;
|
||||
|
||||
if (/code|token|error/.test(window.location.hash)) {
|
||||
qp = window.location.hash.substring(1);
|
||||
qp = window.location.hash.substring(1).replace('?', '&');
|
||||
} else {
|
||||
qp = location.search.substring(1);
|
||||
}
|
||||
|
||||
arr = qp.split("&")
|
||||
arr.forEach(function (v, i, _arr) {
|
||||
_arr[i] = '"' + v.replace('=', '":"') + '"';
|
||||
})
|
||||
arr = qp.split("&");
|
||||
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
|
||||
qp = qp ? JSON.parse('{' + arr.join() + '}',
|
||||
function (key, value) {
|
||||
return key === "" ? value : decodeURIComponent(value)
|
||||
}
|
||||
) : {}
|
||||
function (key, value) {
|
||||
return key === "" ? value : decodeURIComponent(value);
|
||||
}
|
||||
) : {};
|
||||
|
||||
isValid = qp.state === sentState
|
||||
isValid = qp.state === sentState;
|
||||
|
||||
if ((
|
||||
oauth2.auth.schema.get("flow") === "accessCode" ||
|
||||
oauth2.auth.schema.get("flow") === "authorizationCode"
|
||||
oauth2.auth.schema.get("flow") === "accessCode" ||
|
||||
oauth2.auth.schema.get("flow") === "authorizationCode" ||
|
||||
oauth2.auth.schema.get("flow") === "authorization_code"
|
||||
) && !oauth2.auth.code) {
|
||||
if (!isValid) {
|
||||
oauth2.errCb({
|
||||
authId: oauth2.auth.name,
|
||||
source: "auth",
|
||||
level: "warning",
|
||||
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
|
||||
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,18 +47,18 @@
|
||||
oauth2.auth.code = qp.code;
|
||||
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
|
||||
} else {
|
||||
let oauthErrorMsg
|
||||
let oauthErrorMsg;
|
||||
if (qp.error) {
|
||||
oauthErrorMsg = "[" + qp.error + "]: " +
|
||||
(qp.error_description ? qp.error_description + ". " : "no accessCode received from the server. ") +
|
||||
(qp.error_uri ? "More info: " + qp.error_uri : "");
|
||||
oauthErrorMsg = "["+qp.error+"]: " +
|
||||
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
|
||||
(qp.error_uri ? "More info: "+qp.error_uri : "");
|
||||
}
|
||||
|
||||
oauth2.errCb({
|
||||
authId: oauth2.auth.name,
|
||||
source: "auth",
|
||||
level: "error",
|
||||
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
|
||||
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -71,7 +67,13 @@
|
||||
window.close();
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
if (document.readyState !== 'loading') {
|
||||
run();
|
||||
});
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
run();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1 @@
|
||||
{"openapi":"3.0.0","paths":{"/api/{session}/auth/qr":{"get":{"operationId":"AuthController_getQR","summary":"Get QR code for pairing WhatsApp Web.","parameters":[{"name":"session","required":true,"in":"path","description":"WhatsApp session name","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/request-code":{"post":{"operationId":"AuthController_requestCode","summary":"Request authentication code. NOWEB and NOWEB_MOBILE engines only","parameters":[{"name":"session","required":true,"in":"path","description":"WhatsApp session name","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCodeRequest"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/authorize-code":{"post":{"operationId":"AuthController_authorizeCode","summary":"Send OTP authentication code. NOWEB_MOBILE engine only","parameters":[{"name":"session","required":true,"in":"path","description":"WhatsApp session name","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPRequest"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/sessions/start":{"post":{"operationId":"SessionsController_start","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStartRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionDTO"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/stop":{"post":{"operationId":"SessionsController_stop","summary":"Stop session","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStopRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/logout":{"post":{"operationId":"SessionsController_clean","summary":"Logout from session.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionLogoutRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions":{"get":{"operationId":"SessionsController_list","parameters":[{"name":"all","required":false,"in":"query","example":false,"description":"Return all sessions, including those that are in the STOPPED state.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionDTO"}}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/checkNumberStatus":{"get":{"operationId":"ChattingController_checkNumberStatus","summary":"Check number status","parameters":[{"name":"phone","required":true,"in":"query","schema":{"type":"string"}},{"name":"session","required":true,"in":"query","schema":{"default":"default","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WANumberExistResult"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendContactVcard":{"post":{"operationId":"ChattingController_sendContactVcard","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageContactVcardRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendText":{"get":{"operationId":"ChattingController_sendTextGet","summary":"Send a text message","parameters":[{"name":"phone","required":true,"in":"query","schema":{"type":"string"}},{"name":"text","required":true,"in":"query","schema":{"type":"string"}},{"name":"session","required":true,"in":"query","schema":{"default":"default","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]},"post":{"operationId":"ChattingController_sendText","summary":"Send a text message","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageTextRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WAMessage"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendTextButtons":{"post":{"operationId":"ChattingController_sendTextButtons","summary":"Send a text message with buttons","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageTextButtonsRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"taLine truncated
|
||||
{"openapi":"3.1.0","paths":{"/api/{session}/auth/qr":{"get":{"operationId":"AuthController_getQR","summary":"Get QR code for pairing WhatsApp Web.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"},{"name":"format","required":true,"in":"query","schema":{"default":"image","enum":["image","raw"],"type":"string"}}],"responses":{"200":{"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Base64File"},{"$ref":"#/components/schemas/QRCodeValue"}]}}},"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/request-code":{"post":{"operationId":"AuthController_requestCode","summary":"Request authentication code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCodeRequest"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/authorize-code":{"post":{"operationId":"AuthController_authorizeCode","summary":"Send OTP authentication code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPRequest"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/captcha":{"get":{"operationId":"AuthController_getCaptcha","summary":"Get captcha image.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"responses":{"200":{"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Base64File"}]}}},"description":""}},"tags":["auth"],"security":[{"api_key":[]}]},"post":{"operationId":"AuthController_saveCaptcha","summary":"Enter captcha code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptchaBody"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/sessions/start":{"post":{"operationId":"SessionsController_start","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStartRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionDTO"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/stop":{"post":{"operationId":"SessionsController_stop","summary":"Stop session","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStopRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/logout":{"post":{"operationId":"SessionsController_clean","summary":"Logout from session.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionLogoutRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions":{"get":{"operationId":"SessionsController_list","parameters":[{"name":"all","required":false,"in":"query","example":false,"description":"Return all sessions, including those that are in the STOPPED state.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionInfo"}}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/{session}":{"get":{"operationId":"SessionsController_get","parameters":[{"name":"session","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInfo"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/{session}/me":{"get":{"operationId":"SessionController_getMe","summary":"Get information about the authenticated account","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeInfo"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/checkNumberStatus":{"get":{"operationId":"ChattingController_checkNumberStatus","summary":"Check number status","parameters":[{"name":"phone","required":true,"in":"query","schema":{"type":"string"}},{"nLine truncated
|
||||
@@ -0,0 +1,20 @@
|
||||
window.onload = function() {
|
||||
//<editor-fold desc="Changeable Configuration Block">
|
||||
|
||||
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
|
||||
window.ui = SwaggerUIBundle({
|
||||
url: "openapi.json",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
});
|
||||
|
||||
//</editor-fold>
|
||||
};
|
||||
@@ -1,3 +1,3 @@
|
||||
/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=544)}([function(e,t,n){"use strict";e.exports=n(129)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return i(e)?e:J(e)}function r(e){return s(e)?e:K(e)}function o(e){return u(e)?e:Y(e)}function a(e){return i(e)&&!c(e)?e:G(e)}function i(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(a,n),n.isIterable=i,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=a;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m="delete",v=5,g=1<<v,y=g-1,b={},_={value:!1},w={value:!1};function x(e){return e.value=!1,e}function E(e){e&&(e.value=!0)}function S(){}function C(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function A(e){return void 0===e.size&&(e.size=e.__iterate(O)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?A(e)+t:t}function O(){return!0}function j(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return N(e,t,0)}function I(e,t){return N(e,t,t)}function N(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var P=0,M=1,R=2,D="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=D||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function V(e){return e&&"function"==typeof e.next}function W(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(D&&e[D]||e[L]);if("function"==typeof t)return t}function $(e){return e&&"number"==typeof e.length}function J(e){return null==e?ie():i(e)?e.toSeq():ce(e)}function K(e){return null==e?ie().toKeyedSeq():i(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function Y(e){return null==e?ie():i(e)?s(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null==e?ie():i(e)?s(e)?e.entrySeq():e:ue(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=P,F.VALUES=M,F.ENTRIES=R,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return pe(this,e,t,!0)},J.prototype.__iterator=function(e,t){return fe(this,e,t,!0)},t(K,J),K.prototype.toKeyedSeq=function(){return this},t(Y,J),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return pe(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return fe(this,e,t,!1)},t(G,J),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},J.isSeq=ae,J.Keyed=K,J.Set=G,J.Indexed=Y;var Z,X,Q,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ae(e){return!(!e||!e[ee])}function ie(){return Z||(Z=new te([]))}function se(e){var t=Array.isArray(Line truncated
|
||||
//# sourceMappingURL=swagger-ui-bundle.js.map
|
||||
!function webpackUniversalModuleDefinition(i,s){"object"==typeof exports&&"object"==typeof module?module.exports=s():"function"==typeof define&&define.amd?define([],s):"object"==typeof exports?exports.SwaggerUIBundle=s():i.SwaggerUIBundle=s()}(this,(()=>(()=>{var i={17967:(i,s)=>{"use strict";s.Nm=s.Rq=void 0;var u=/^([^\w]*)(javascript|data|vbscript)/im,m=/&#(\w+)(^\w|;)?/g,v=/&(newline|tab);/gi,_=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,j=/^.+(:|:)/gim,M=[".","/"];s.Rq="about:blank",s.Nm=function sanitizeUrl(i){if(!i)return s.Rq;var $=function decodeHtmlCharacters(i){return i.replace(_,"").replace(m,(function(i,s){return String.fromCharCode(s)}))}(i).replace(v,"").replace(_,"").trim();if(!$)return s.Rq;if(function isRelativeUrlWithoutProtocol(i){return M.indexOf(i[0])>-1}($))return $;var W=$.match(j);if(!W)return $;var X=W[0];return u.test(X)?s.Rq:$}},79742:(i,s)=>{"use strict";s.byteLength=function byteLength(i){var s=getLens(i),u=s[0],m=s[1];return 3*(u+m)/4-m},s.toByteArray=function toByteArray(i){var s,u,_=getLens(i),j=_[0],M=_[1],$=new v(function _byteLength(i,s,u){return 3*(s+u)/4-u}(0,j,M)),W=0,X=M>0?j-4:j;for(u=0;u<X;u+=4)s=m[i.charCodeAt(u)]<<18|m[i.charCodeAt(u+1)]<<12|m[i.charCodeAt(u+2)]<<6|m[i.charCodeAt(u+3)],$[W++]=s>>16&255,$[W++]=s>>8&255,$[W++]=255&s;2===M&&(s=m[i.charCodeAt(u)]<<2|m[i.charCodeAt(u+1)]>>4,$[W++]=255&s);1===M&&(s=m[i.charCodeAt(u)]<<10|m[i.charCodeAt(u+1)]<<4|m[i.charCodeAt(u+2)]>>2,$[W++]=s>>8&255,$[W++]=255&s);return $},s.fromByteArray=function fromByteArray(i){for(var s,m=i.length,v=m%3,_=[],j=16383,M=0,$=m-v;M<$;M+=j)_.push(encodeChunk(i,M,M+j>$?$:M+j));1===v?(s=i[m-1],_.push(u[s>>2]+u[s<<4&63]+"==")):2===v&&(s=(i[m-2]<<8)+i[m-1],_.push(u[s>>10]+u[s>>4&63]+u[s<<2&63]+"="));return _.join("")};for(var u=[],m=[],v="undefined"!=typeof Uint8Array?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=0;j<64;++j)u[j]=_[j],m[_.charCodeAt(j)]=j;function getLens(i){var s=i.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=i.indexOf("=");return-1===u&&(u=s),[u,u===s?0:4-u%4]}function encodeChunk(i,s,m){for(var v,_,j=[],M=s;M<m;M+=3)v=(i[M]<<16&16711680)+(i[M+1]<<8&65280)+(255&i[M+2]),j.push(u[(_=v)>>18&63]+u[_>>12&63]+u[_>>6&63]+u[63&_]);return j.join("")}m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63},48764:(i,s,u)=>{"use strict";const m=u(79742),v=u(80645),_="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;s.Buffer=Buffer,s.SlowBuffer=function SlowBuffer(i){+i!=i&&(i=0);return Buffer.alloc(+i)},s.INSPECT_MAX_BYTES=50;const j=2147483647;function createBuffer(i){if(i>j)throw new RangeError('The value "'+i+'" is invalid for option "size"');const s=new Uint8Array(i);return Object.setPrototypeOf(s,Buffer.prototype),s}function Buffer(i,s,u){if("number"==typeof i){if("string"==typeof s)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(i)}return from(i,s,u)}function from(i,s,u){if("string"==typeof i)return function fromString(i,s){"string"==typeof s&&""!==s||(s="utf8");if(!Buffer.isEncoding(s))throw new TypeError("Unknown encoding: "+s);const u=0|byteLength(i,s);let m=createBuffer(u);const v=m.write(i,s);v!==u&&(m=m.slice(0,v));return m}(i,s);if(ArrayBuffer.isView(i))return function fromArrayView(i){if(isInstance(i,Uint8Array)){const s=new Uint8Array(i);return fromArrayBuffer(s.buffer,s.byteOffset,s.byteLength)}return fromArrayLike(i)}(i);if(null==i)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(isInstance(i,ArrayBuffer)||i&&isInstance(i.buffer,ArrayBuffer))return fromArrayBuffer(i,s,u);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(i,SharedArrayBuffer)||i&&isInstance(i.buffer,SharedArrayBuffer)))return fromArrayBuffer(i,s,u);if("number"==typeof i)throw new TypeError('The "value" argument must not be of type number. Received type number');const m=i.valueOf&&i.valueOf();if(null!=m&&m!==i)return Buffer.from(m,s,u);const v=function fromObject(i){if(Buffer.isBuffer(i)){const s=0|checked(i.length),u=createBuffer(s);return 0===u.length||i.copy(u,0,0,s),u}if(void 0!==i.length)return"number"!=typeof i.length||numberIsNaN(i.length)?createBuffer(0):fromArrayLike(i);if("Buffer"===i.type&&Array.isArray(i.data))return fromArrayLike(i.data)}(i);if(v)return v;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof i[Symbol.toPrimitive])return Buffer.from(i[Symbol.toPrimitive]("string"),s,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function assertSize(i){if("number"!=typeof i)throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function allocUnsafe(i){return assertSize(i),createBuffer(i<0Line truncated
|
||||
//# sourceMappingURL=swagger-ui-bundle.js.map
|
||||