GetChats#
The method is intended for getting the chat list of the current account.
The method uses limits on the request rate per second.
Request#
To get the contact list, you need to execute a request at:
GET
{{apiUrl}}/waInstance{{idInstance}}/getChats/{{apiTokenInstance}}
To get the apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Response#
Response fields#
| Field | Type | Description |
|---|---|---|
chatId | string | Chat or group chat identifier |
name | string | Chat name (the group name or the contact name) |
type | string | Chat type. Can take the values "user", "group", "supergroup", "channel" |
phoneNumber | integer | Contact's phone number If the phone number is hidden, or the contact is a group, it takes the value 0 |
username | string | Telegram username that starts with the @ character |
Response body example#
[
{
"chatId": "-10000000000000",
"name": "GREEN-API Super Group",
"type": "supergroup",
"phoneNumber": 0,
"username": "@green_api_supergroup"
},
{
"chatId": "10000000",
"name": "Vasilisa the Wise",
"type": "user",
"phoneNumber": 79876543210,
"username": "@vasilisa"
},
{
"chatId": "-5098765432",
"name": "GREEN-API Group",
"type": "group",
"phoneNumber": 0,
"username": ""
}
]
Errors#
For the list of errors common to all methods, see the Common errors section
| HTTP code | Error description | Possible solutions |
|---|---|---|
| 200 | The method returns an empty array [] | Contact the technical support service |