Use this method to add a blacklist.
Field
Type
Required
Description
method
String
Yes
"addBlacklist"
chat
Yes
Unique identifier for Group or Channel.
users
Array of String
Yes
Add list of users (mobile or Email) to blacklist.

Requests

json
{ "method": "addBlacklist", "users": [ "16136147500", "test001@gmail.com" ], "chat_id": "4841125448885442667774" }
java
ArrayList<String> users = new ArrayList<>(); users.add("16136147500"); users.add("test001@gmail.com"); api.addBlackList(incomingMsg.getChat().getId(), users); public void addBlackList(String chatId, List<String> users) { AddBlackListOutMessage addBlackListOutMessage = new AddBlackListOutMessage(); addBlackListOutMessage.setChatId(chatId); addBlackListOutMessage.setUsers(users); api.send(addBlackListOutMessage); } AddBlackListOutMessage addBlackListOutMessage = new AddBlackListOutMessage(); addBlackListOutMessage.setChatId(chatId); addBlackListOutMessage.setUsers(users); api.send(addBlackListOutMessage);
javascript
let users = []; users.push("16136147500"); users.push("test001@gmail.com"); api.addBlackList(incomingMsg.chat.id, users);

Response

json
{ "method": "blacklist", "blacklist": { "chat": { "id": "90090684293612221" }, "eop": "19", "users": [{ "id": "2", "signup_user": "201116601107" }, { "id": "4", "signup_user": "201116601109" }, { "id": "5", "signup_user": "201116601111" }, { "id": "14", "signup_user": "1111111" }, { "id": "15", "signup_user": "222222" }, { "id": "19", "signup_user": "222223" } ] } }