Skip to main content

Set group picture

Sets the image as the group chat avatar

Function SetGroupPicture(Val AccessParameters, Val ChatID, Val Image) Export

ParameterCLI optionTypeRequiredDescription
AccessParameters--accessStructure Of KeyAndValueAccess parameters. See FormAccessParameters
ChatID--chatStringGroup chat ID
Image--pictureString, BinaryDataImage in jpg format

Returns: Map Of KeyAndValue - serialized JSON response from Green API


tip

Method at API documentation: SetGroupPicture

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
    ApiUrl           = "https://3100.api.green-api.com/v3";
MediaUrl = "https://3100.api.green-api.com/v3";
IdInstance = "31003...";
ApiTokenInstance = "17915d8e0b4b4975a183478da...";

Image = "https://hut.openintegrations.dev/test_data/spy2.png"; // URL, Path or Binary Data
ChatID = 12345678;

AccessParameters = OPI_GreenMax.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenMax.SetGroupPicture(AccessParameters, ChatID, Image);
    # JSON data can also be passed as a path to a .json file

oint greenmax SetGroupPicture \
--access "{'apiUrl':'***','mediaUrl':'https://3100.api.green-api.com/v3','idInstance':'3100309139','apiTokenInstance':'***'}" \
--chat "-68929070366805" \
--picture "https://hut.openintegrations.dev/test_data/spy2.png"
Result
{
"reason": "",
"urlAvatar": "https://i.oneme.ru/i?r=BTE2sh_eZW7g8kugOdIm2NotIqdtf2SPYD17MNKE796L5-wrhvlDEOW1iIJhtqeQnyQ",
"setGroupPicture": true
}