Skip to content

GetChats#

Beta version

The functionality is in beta. Features may change and may also work unstably.

The method returns the list of chats of the account: personal chats and group chats.

The chats are returned from the first pages of the Instagram chat list: a very long list may be incomplete.

The method uses the limits on the number of requests per second.

Request#

To get the list of chats, you have to execute a request at:

GET
{{apiUrl}}/waInstance{{idInstance}}/getChats/{{apiTokenInstance}}

For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.

Response#

Response parameters#

Field Type Description
chatId string The chat identifier: the numeric identifier of the contact or of the group chat
name string The name of the contact from the Instagram profile (if there is no name - the username without @) or the name of the group
username string The username of the contact with the @ prefix. An empty string for a group
type string The type of the chat: user - a personal chat, bot - a chat with the Meta AI bot, group - a group chat

Response body example#

[
    {
        "chatId": "49547665464",
        "name": "GREEN-API",
        "username": "@green_api",
        "type": "user"
    },
    {
        "chatId": "340282366841710300949128174631143137232",
        "name": "Work group",
        "username": "",
        "type": "group"
    }
]

GetChats errors#

For a list of errors common to all methods, refer to the Common errors section

Request examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/getChats/{{apiTokenInstance}}"

response = requests.get(url)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getChats/{{apiTokenInstance}}'