1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-18 23:48:56 +02:00
OpenIntegrations/docs/en/examples/Bitrix24/CreateChat.txt

35 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-08-13 13:35:37 +02:00
 Image = FunctionParameters["Picture"];
OPI_TypeConversion.GetBinaryData(Image);
B64Image = GetBase64StringFromBinaryData(Image);
MembersArray = New Array;
MembersArray.Add(10);
MembersArray.Add(1);
ChatStructure = New Structure;
ChatStructure.Insert("TYPE" , "OPEN");
ChatStructure.Insert("TITLE" , "New chat");
ChatStructure.Insert("DESCRIPTION", "This is a new chat");
ChatStructure.Insert("COLOR" , "GREEN");
ChatStructure.Insert("MESSAGE" , "Welcome to new chat");
ChatStructure.Insert("USERS" , MembersArray);
ChatStructure.Insert("AVATAR" , B64Image);
ChatStructure.Insert("OWNER_ID" , 1);
URL = FunctionParameters["Bitrix24_URL"];
Result = OPI_Bitrix24.CreateChat(URL, ChatStructure);
OPI_TestDataRetrieval.WriteLog(Result, "CreateChat (wh)", "Bitrix24");
URL = FunctionParameters["Bitrix24_Domain"];
Token = FunctionParameters["Bitrix24_Token"];
ChatStructure = New Structure;
ChatStructure.Insert("TYPE" , "CHAT");
ChatStructure.Insert("TITLE" , "Private chat");
ChatStructure.Insert("USERS" , MembersArray);
Result = OPI_Bitrix24.CreateChat(URL, ChatStructure, Token);