Skip to content

GetContacts Test#

The method is aimed for getting a list of the current account contacts.

Updating information about contacts can take up to 5 minutes.

If an empty data array is received - repeat the method call.


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

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

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


Response parameters#

Parameter Type Description
id string User or group chat Id
name string Contact name. Possible variants:
1) If there is incoming correspondence/reactions from the account, then we get the name from the WhatsApp profile
2) If there is no incoming correspondence/reactions from the account, then we get an empty line
contactName string Contact name from the phone book
type string Contact type. Possible variants:
user - contact belongs to a user
group - contact is a group chat

Response body example#

        "id": "",
        "name": "Ivan Petrov",
        "contactName": "Ivan Petorov Work",
        "type": "user"
        "id": "",
        "name": "Lyusya Sidorova",
        "contactName": "Liusya Sidorova Sewing Circle",
        "type": "user"
        "id": "",
        "name": "My group",  
        "type": "group"

GetContacts errors#

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

HTTP code Error description Possible solutions
200 The getContacts method returns an empty array [] 1. Rescan the QR code.
2. Contact technical support.

Request examples#

import requests

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

payload = {}
headers= {}

response = requests.request("GET", url, headers=headers, data = payload)

curl --location '{{APIUrl}}/waInstance{{idInstance}}/getContacts/{{apiTokenInstance}}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();

var response =, HttpMethod.GET, null, String.class);
var requestUrl = new StringBuilder();

var response = Unirest.get(requestUrl.toString())
    .header("Content-Type", "application/json")

Sub GetContacts()
    Dim url As String
    Dim http As Object
    Dim response As String

    ' The apiUrl, idInstance and apiTokenInstance values are available in console, double brackets must be removed
    url = "{{apiUrl}}/waInstance{{idInstance}}/GetContacts/{{apiTokenInstance}}"

    Set http = CreateObject("MSXML2.XMLHTTP")

    http.Open "GET", url, False

    response = http.responseText

    Debug.Print response

    ' Outputting the answer to the desired cell
    Range("A1").Value = response

    Set http = Nothing
End Sub