Skip to main content

Change chat picture

Setup new chat picture

Function ChangeChatPicture(Val URL, Val ChatID, Val Image, Val Token = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringURL of webhook or a Bitrix24 domain, when token used
ChatID--chatString, NumberChat ID
Image--pictureString, BinaryDataPicture data
Token--tokenStringAccess token, when app auth method used

Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API


tip

Method at API documentation: im.chat.updateAvatar

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


1C:Enterprise/OneScript code example
    URL    = "https://b24-ar17wx.bitrix24.by/rest/1/yg2...";
ChatID = "1458";

Image = "https://api.athenaeum.digital/test_data/picture2.jpg";

Result = OPI_Bitrix24.ChangeChatPicture(URL, ChatID, Image);

URL = "b24-ar17wx.bitrix24.by";
Token = "2f4e4067006e9f06006b12e400000001000...";
ChatID = "1460";

Result = OPI_Bitrix24.ChangeChatPicture(URL, ChatID, Image, Token);
    oint bitrix24 ChangeChatPicture \
--url "b24-ar17wx.bitrix24.by" \
--chat 1476 \
--picture "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg" \
--token "***"
Result
{
"result": true,
"time": {
"start": 1728454891.85277,
"finish": 1728454893.18775,
"duration": 1.33497500419617,
"processing": 1.30738711357117,
"date_start": "2024-10-09T09:21:31+03:00",
"date_finish": "2024-10-09T09:21:33+03:00",
"operating_reset_at": 1728455491,
"operating": 1.30736899375916
}
}