Use this method to add whitelist patterns.
Field | Type | Required | Description |
method | String | Yes | "addWhitelistPatterns" |
chat | Yes | Unique identifier for Group or Channel. | |
data | Array of Data | Yes | Add an array of Patterns. |
Requests
json{ "method": "addWhitelistPatterns", "data": [{ "pattern": "558741", "example": "58441254" } ], "chat_id": "455522587441369002" }
javaArrayList<Data> dataList = new ArrayList<>(); Data data = new Data(); data.setPattern("4444*"); data.setExample("444444"); dataList.add(data); api.addWhitelistPatterns(incomingMsg.getChat().getId(), dataList); public void addWhitelistPatterns(String chatId, List<Data> data) { AddWhitelistPatternsOutMessage addWhitelistPatternsOutMessage = new AddWhitelistPatternsOutMessage(); addWhitelistPatternsOutMessage.setChatId(chatId); addWhitelistPatternsOutMessage.setData(data); api.send(addWhitelistPatternsOutMessage); }
javascriptlet dataList = []; let data = new Data(); data.pattern = "4444*"; data.example = "444444"; dataList.push(data); api.addWhitelistPatterns(incomingMsg.chat.id, dataList);
Response
json{ "method": "whitelist", "whitelist": { "chat": { "id": "90090684293612221" }, "eop": "13", "users": [{ "id": "645", "signup_user": "25648", "tags": ["1", "2"] } ] }