Instances API

Введение

Instances API доступно только для подключений WhatsApp.
{id} == ID подключения WhatsApp.
chat_id можно получить из /dialogs или из вебхука. Для личной переписки он имеет формат: [email protected].

GET /whatsapp/{id}/status

Получить статус соединения с телефоном.
Хороший статус:
1
{
2
"accountStatus": "authenticated",
3
"statusData": {
4
"title": "Не отключайте свой телефон",
5
"msg": "WhatsApp подключается к вашему телефону, чтобы синхронизировать сообщения. Чтобы снизить трафик данных, подключите телефон к Wi-Fi.",
6
"substatus": "normal",
7
"actions": {}
8
}
9
}
Copied!
Необходимо отсканировать QR-код в мобильном приложении WhatsApp:
1
{
2
"accountStatus": "got qr code",
3
"qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZoAAAGaCAYAAAA2BoVjAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH5AMNDCop0Aj8GQAAF4pJREFUeNrt3fmbFOWBwPH8Dckma0w2azYbN9lks/FAUA5RxBs5FBUEj8SgKB54GzwQJWo8EO/7Bo9444ln1HiuB24ANYq3ciqsgCe+y9vP4/NMd3XPDMNM1Vs9n+/z9A8MPVM9PdXvp6ur6q3vBEmSurDveAokSaCRJIFGkiTQSJJAI0kCjSRJoJEkgUaSBBpJkkAjSQKNJAk0kiSBRpIEGkmSQCNJAo0kCTSSJIFGkgQaSRJoJEkCjSQJNJIk0EiSBBpJEmgkSQKNJAk0kiTQSJIEGkkSaCRJoJEkCTSSJNBIkkAjSRJoJEmgkSSBRpIk0EiSQCNJEmgkSaCRJIFGkiTQSJJAI0kCjSRJoJEkgUaSBBpJkkAjSQKNJEmgkSSBRpIEGkmSQCNJAo0kCTSSJIFGkgQaSRJoJEkCjSQJNJIk0EiSBBpJEmgkSQKNJAk0kiTQSJIEGkkSaCRJoJEkCTSSJNCUtO/+ZoNS3lJ93vJ6rvN6zJ35uzTbuu61JtBY+UED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wauZtJgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wMy0xM1QxMjo0Mjo0MSswMDowMBu71ZoAAAAASUVORK5CYII=",
4
"statusData": {
5
"qr": "[email protected],116RB0rOgLrzRP323WSOC+OgZ2jDAk+lQXg827a99z0=,IGB0FpqtusUFMB1Wd8wrig==",
6
"substatus": "normal"
7
}
8
}
Copied!

GET /whatsapp/{id}/dialogs

Получить список диалогов.
1
{
2
"dialogs": [
3
{
5
"name": "Radist Online",
6
"image": "https://pps.whatsapp.net/v/t61.24694-24/71195497_147622373164341_951220358176310102_n.jpg?oe=5E6F3857&oh=a562668bcbf9d1d1132f9d61337d1c22",
7
"metadata": {
8
"isGroup": false,
9
"participants": [],
10
"groupInviteLink": null
11
}
12
},
13
{
14
15
"name": "Radist",
16
"image": "",
17
"metadata": {
18
"isGroup": true,
19
"participants": [
22
],
23
"groupInviteLink": null
24
}
25
}
26
]
27
}
Copied!

GET /whatsapp/{id}/check_phone

Проверить, есть ли на номере WhatsApp.
Рекомендуем кешировать на вашей стороне.
Query-параметры:
required
name
type
allowed
+
phone
string
1
{"result": "exists"}
Copied!
1
{"result": "not exists"}
Copied!

POST /whatsapp/{id}/send_message

Отправить текстовое сообщение.
Тело запроса:
required
name
type
description
+
chat_id
string
chat_id получателя
+
text
string
текст сообщения
1
{
2
"sent": true,
3
"message": "Sent to [email protected]",
4
"id": "[email protected]_3EB0179E2EB8D7A4B678",
5
"queueNumber": 67360
6
}
Copied!

POST /whatsapp/{id}/send_file

Отправить файл.
Тело запроса:
required
name
type
description
+
chat_id
string
chat_id получателя
+
url
string
прямая ссылка на файл
+
file_name
string
имя файла

POST /whatsapp/{id}/takeover

Переключить соединение. Если на устройстве был открыт WhatsApp Web, этим методом можно подключить аккаунт обратно к нам.

POST /whatsapp/{id}/reboot

Перезапустить инстанс. Перезапуск может занимать до нескольких минут. Не используйте без необходимости.
Last modified 4mo ago