ReadChat#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method marks a chat as read.
The method uses the limits on the number of requests per second.
Request#
To mark a chat as read, you have to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/readChat/{{apiTokenInstance}}
For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Request parameters#
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
chatId | string | Yes | Chat identifier - the numeric identifier of an account or of a group chat, or a username with the @ prefix |
idMessage | string | No | The message identifier up to which (inclusive) the chat is marked as read. If not passed, the whole chat is marked as read |
Request body example#
{
"chatId": "49547665464"
}
Up to a message, inclusive:
{
"chatId": "49547665464",
"idMessage": "32992354783594572492903878028689408"
}
Response#
Response parameters#
| Field | Type | Description |
|---|---|---|
setRead | boolean | true - the chat has been marked as read; false - there is no mark: the chat has no messages or Instagram has not accepted the mark |
Response body example#
{
"setRead": true
}
The mark has not been set:
{
"setRead": false
}
ReadChat errors#
For a list of errors common to all methods, refer to the Common errors section
| HTTP code | Error ID | Description |
|---|---|---|
| 400 | Bad Request Validation failed | Validation error |
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/readChat/{{apiTokenInstance}}"
payload = {"chatId": "49547665464"}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/readChat/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"chatId": "49547665464"}'