Use this method to add blacklist patterns, preventing only users who match a specific pattern (e.g.,
*@company.com
) from signign up for the app.Field | Type | Required | Description |
method | String | Yes | "addblacklistPatterns" |
app_id | String | Yes | Unique identifier for App. |
patterns | Yes | An array of blacklist patterns to be added (e.g., ["@company.com", "+1*"] ). | |
reference | String | Optional | Unique identifier for the request. |
Preconditions for API Functionality
The following tables outline the preconditions that must be met for the API to function correctly. Failure to meet these conditions may result in errors or unexpected behavior.
- Preconditions for API permissions
Before performing signup management messages, ensure the following conditions are met:
Action | Required Permission | Description |
signup Management | " Signup Management " | The API must have the " Signup Management " permission to manage both whitelist and blacklist settings. |
Response
addBlacklistPatterns_ack
â
On success, the
addBlackListPatterns_ack
method is returned with an echo of the whitelist patterns
object.Field | Type | Returned | Description |
method | String | Yes | "addBlacklistPatterns_ack" |
app_id | String | Yes | Unique identifier for App. |
data | Yes | An array of blacklist patterns. | |
reference | String | Optional | Unique identifier echoed from the request. |
Request:
json{ "method": "addBlacklistPatterns", "app_id": "90090684293000559", "patterns": [ { "pattern": ".*@gmail.com", } ], "reference": 111111148 }
javaArrayList<Data> dataList = new ArrayList<>(); Data data = new Data(); data.setPattern(".*@gmail.com"); dataList.add(data); api.addBlacklistPatterns(incomingMsg.getChat().getId(), dataList); public void addBlacklistPatterns(String chatId, List<Data> data) { AddBlacklistPatternsOutMessage addBlacklistPatternsOutMessage = new AddBlacklistPatternsOutMessage(); addBlacklistPatternsOutMessage.setChatId(chatId); addBlacklistPatternsOutMessage.setData(data); api.send(addBlacklistPatternsOutMessage); }
javascriptlet dataList = []; let data = new Data(); data.pattern = ".*@gmail.com"; dataList.push(data); api.addBlackListPatterns(chat.id, dataList);
python
Response
json{ "method": "addBlacklistPatterns_ack", "data": [ { "pattern": ".*@gmail.com", "id": "487", } ], "app_id": "90090684293000559", "reference": "111111148", }