Skip to main content

Create group

Creates a new group chat with the specified name

Function CreateGroup(Val AccessParameters, Val Name, Val Members) Export

ParameterCLI optionTypeRequiredDescription
AccessParameters--accessStructure Of KeyAndValueAccess parameters. See FormAccessParameters
Name--nameStringGroup name
Members--membersArray Of String, StringArray of group member IDs or a single ID

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


tip

Method at API documentation: CreateGroup


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...";

UserID = 87654321;
Name = "New group";

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

oint greenmax CreateGroup \
--access "{'apiUrl':'***','mediaUrl':'https://3100.api.green-api.com/v3','idInstance':'3100309139','apiTokenInstance':'***'}" \
--name "New group" \
--members "87654321"
Result
{
"created": true,
"chatId": "-68935456522325",
"groupInviteLink": "https://max.ru/join/rgJY3pghbhHuB1-C4LAXvwr_nMi05Tad5OOh5xDPZbc"
}