AddGroupParticipant#
The method adds a participant to a group chat.
Request#
To add a participant to a group chat, you have to execute a request at:
POST https://api.green-api.com/waInstance{{idInstance}}/addGroupParticipant/{{apiTokenInstance}}
For idInstance
and apiTokenInstance
request parameters, refer to Before you start section.
Request parameters#
Parameter | Type | Mandatory | Description |
---|---|---|---|
groupId | string | Yes | Group chat Id |
participantChatId | string | Yes | Id of a participant added to a group chat. |
Request body example#
Adding a participant to a group chat:
{
"groupId": "11001234567-1587570015@g.us",
"participantChatId": "79001234565@c.us"
}
Response#
Response parameters#
Parameter | Type | Description |
---|---|---|
addParticipant | boolean | Adding a participant to a group chat flag |
Response body example#
{
"addParticipant": true
}
AddGroupParticipant errors#
For a list of errors common to all methods, refer to Common errors section
Python request example#
import requests
url = "https://api.green-api.com/waInstance{{idInstance}}/addGroupParticipant/{{apiTokenInstance}}"
payload = "{\r\n\t\"groupId\": \"11001234567-1581234048@g.us\",\r\n\t\"participantChatId\": \"79001234568@c.us\"\r\n}"
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))