Skip to content

GetAvatar#

Beta version

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

The method returns the link to the avatar of a contact.

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

Request#

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

POST
{{apiUrl}}/waInstance{{idInstance}}/getAvatar/{{apiTokenInstance}}

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

Request parameters#

Parameter Type Mandatory Description
chatId string Yes The numeric account identifier or a username with the @ prefix

Request body example#

{
    "chatId": "49547665464"
}

Response#

Response parameters#

Field Type Description
urlAvatar string The link to the avatar. An empty string means there is no avatar

Response body example#

{
    "urlAvatar": "https://instagram.ftse3-2.fna.fbcdn.net/v/t51.2885-19/495386024_18031684346649465_5390906708136372152_n.jpg?efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby41MDAuYzIifQ&_nc_ht=instagram.ftse3-2.fna.fbcdn.net&_nc_cat=109&_nc_oc=Q6cZ2gFYb76TFMAltxyIuECYSkeKF15EWC0Ewtgt_FxzjEto8qeTbbYkzC4i5Mr2sPRmxCw&_nc_ohc=JEfpfr8uH-EQ7kNvwFa8Qqc&_nc_gid=A4BiW9omBwmCnTODEk03_g&edm=APs17CUBAAAA&ccb=7-5&ig_cache_key=GKj9hh15Gy_suA9AALgnvbsWWdBKbvEnAQAB0j-ccb7-5&oh=00_AQKIjxJWaZU_pmN8R0orM_ejwdU76mlR8XrQ08loqbKeGg&oe=6AB7F464&_nc_sid=10d13b"
}

GetAvatar errors#

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

HTTP code Error ID Description
400 Bad Request
Validation failed
Validation error

Request examples#

import requests

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

payload = {"chatId": "49547665464"}
headers = {'Content-Type': 'application/json'}

response = requests.post(url, json=payload, headers=headers)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getAvatar/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"chatId": "49547665464"}'