Skip to content

GetContacts#

Beta version

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

The method returns the list of contacts of the account - the contacts known to the instance from the chats.

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

Request#

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

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

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

Response#

Response parameters#

Field Type Description
chatId string The numeric account identifier
name string The name from the Instagram profile. If the profile has no name - the username without @
username string The username with the @ prefix
type string The type of the contact: user - an account, bot - the Meta AI bot

Response body example#

[
    {
        "chatId": "49547665464",
        "name": "GREEN-API",
        "username": "@green_api",
        "type": "user"
    },
    {
        "chatId": "25025320",
        "name": "Instagram",
        "username": "@instagram",
        "type": "user"
    }
]

GetContacts errors#

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

Request examples#

import requests

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

response = requests.get(url)

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