Skip to content

GetAvatar Test#

The method returns a user or a group chat avatar.


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


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

Request parameters#

Parameter Type Mandatory Description
chatId string Yes User or group chat Id

Request body example#

To get your avatar - specify your number in chatId ("{your number}").

Get user avatar:

    "chatId": ""

Get group chat avatar:

    "chatId": ""


Response parameters#

Parameter Type Description
urlAvatar string Link to a user or a group chat avatar. The parameter takes an empty value if the avatar is not set
available boolean A flag that indicates the availability of the correspondent's avatar or group chat. The parameter takes the value false if the correspondent has chat privacy enabled

Response body example#

      "urlAvatar": "",
      "available": true

GetAvatar errors#

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

Request examples#

import requests

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

payload = "{\r\n    \"chatId\": \"\"\r\n}"
headers = {
  'Content-Type': 'application/json'

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

curl --location '{{apiUrl}}/waInstance{{idInstance}}/getAvatar/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "chatId": ""
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();

var headers = new HttpHeaders();

var jsonBody = "{\"chatId\": \"\"}";

var requestEntity = new HttpEntity<>(jsonBody, headers);

var response =, HttpMethod.POST, requestEntity, String.class);
var requestUrl = new StringBuilder();

var response =
    .header("Content-Type", "application/json")
    .body("{\"chatId\": \"\"}")

Sub GetAvatar()
    Dim url As String
    Dim RequestBody 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}}/GetAvatar/{{apiTokenInstance}}"

    ' chatId - is the number to send the message to ( for private chats, for group chats)
    RequestBody = "{""chatId"":""""}"

    Set http = CreateObject("MSXML2.XMLHTTP")

    With http
        .Open "POST", url, False
        .setRequestHeader "Content-Type", "application/json"
        .Send RequestBody
    End With

    response = http.responseText

    Debug.Print response

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

    Set http = Nothing
End Sub