Use this method to add whitelist.
Field | Type | Required | Description |
method | String | Yes | "addToWhitelist" |
app_id | String | Yes | Unique identifier for the App to which the user belongs. |
signups | Yes | Add an array of signups. | |
reference | String | Yes | A unique reference for the request (used for tracking or logging). |
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. |
- Preconditions for Web Admin of Your App
Before performing signup whitelist management messages, ensure the following conditions are met:
Action | Description |
Enable "User Whitelist" | Activate the "Use Whitelist" flag from Web Admin/Signup Settings/Signup Filter to enforce whitelist filtering. |
If you add the same user to the blacklist and whitelist, the priority goes to the blacklist.
This feature is limited to apps created using the nandbox app builder.
Response
addToWhitelist_ack
β
On success, the
addToWhitelist_ack
method is returned, including an echo of the signup record.Field | Type | Returned | Description |
method | String | Yes | "addtoWhitelist_ack " |
app_id | String | Yes | Unique identifier for App. |
signups | Yes | Array of Whitelist signup objects | |
reference | String | Optional | Unique identifier echoed from the request. |
SDK Mapping β addToWhiteList
SDK | Request Method | Response Callback |
Java | List<WhiteListUser> users = new ArrayList<>();
WhiteListUser user = new WhiteListUser();
user.setSignupUser(" allowed@gmail.com ");
users.add(user);
api.addWhiteList(users,appId,reference); | onWhiteList(WhiteList whiteList) |
JavaScript | onWhiteList(whiteList) | |
Python | users = [" allowed@gmail.com "]
napi.add_white_list(
users=users,
app_id=app_id,
reference=reference
) | on_white_list(self, white_list) |
Example
Requests
json{ "method": "addToWhitelist", "app_id": "90090684293000559", "reference": 111111148, "signups": [ { "signup_id": "name@example.com", "tags": ["4"] } ] }
javaList<WhiteListUser> users = new ArrayList<>(); WhiteListUser user = new WhiteListUser(); user.setSignupUser("allowed@gmail.com"); users.add(user); api.addWhiteList(users, Long.valueOf("90090684293000559"), null);
javascriptlet users = ["allowed@gmail.com"]; api.addWhiteList(users, "90090684293000559", null);
pythonusers = ["allowed@gmail.com"] napi.add_white_list(users=users, app_id="90090684293000559", reference=None)
Response
json{ "method": "addToWhitelist_ack", "app_id": "90090684293000559", "signups": [ { "id": "488", "signup_id": "name@example.com", "tags": [ "4" ] } ], "reference": 111111148 }