Use this method to add whitelist patterns, allowing only users who match a specific pattern (e.g.,
*@company.com
) to sign up for the app.Field | Type | Required | Description |
method | String | Yes | "addWhitelistPatterns" |
app_id | String | Yes | Unique identifier for App. |
patterns | Yes | An array of whitelist 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
addWhitelistPatterns_ack
â
On success, the
addWhiteListPatterns_ack
method is returned with an echo of the whitelist patterns
object.Field | Type | Returned | Description |
method | String | Yes | "addWhitelistPatterns_ack" |
app_id | String | Yes | Unique identifier for App. |
data | Yes | An array of whitelist patterns. | |
reference | String | Optional | Unique identifier echoed from the request. |
Request:
json{ "method": "addWhitelistPatterns", "chat_id": "90090684293000559", "reference": 111111148, "app_id": "90090684293000559", "patterns": [ { "pattern": ".*@gmail.com", "tags": ["4"] } ] }
javaArrayList<Data> dataList = new ArrayList<>(); Data data = new Data(); data.setPattern(".*@gmail.com"); 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 = ".*@gmail.com"; dataList.push(data); api.addWhitelistPatterns(incomingMsg.chat.id, dataList);
python
Response
json{ "method": "addWhitelistPatterns_ack", "data": [ { "pattern": ".*@gmail.com", "id": "495", "tags": ["4"] } ], "app_id": "90090684293000559", "chat_id": "90090684293000559", "reference": 111111148 }