Get whitelist & blacklist¶
Fetch all global whitelist & blacklist rules
- HTTP Method:
GET
- URL:
https://example.domain.tld/api/v1/antispam/wlbl/global/
- Require authentication:
Yes
- Permission level required:
MasterAdmin
Response parameters¶
Parameter | Type | Description |
---|---|---|
blacklist_status | str | Status of blacklist |
blacklisted_sender_domains | list | List of blacklisted sender domains |
blacklisted_sender_emails | list | List of blacklisted sender emails |
blacklisted_sender_ips | list | List of blacklisted sender IPs/CIDRs |
whitelist_status | str | Status of whitelist |
whitelisted_sender_domains | list | List of whitelisted sender domains |
whitelisted_sender_emails | list | List of whitelisted sender emails |
whitelisted_sender_ips | list | List of whitelisted sender IPs/CIDRs |
Example request (Python)¶
import requests
import json
from pprint import pprint
url = "https://example.domain.tld/api/v1/antispam/wlbl/global/"
r = requests.get(url, auth=("admin","long-auth_token-here"))
try:
pprint(r.json())
except:
print(r.text)
Example response (JSON)¶
{
'blacklist_status': 'applied',
'blacklisted_sender_domains': ['bad-domain.tld', 'another-bad-domain.tld'],
'blacklisted_sender_emails': ['user@bad-domain.tld', 'user@another-bad-domain.tld'],
'blacklisted_sender_ips': ['172.16.11.255', '203.0.113.0/24'],
'whitelist_status': 'applied',
'whitelisted_sender_domains': ['good-domain.tld', 'another-good-domain.tld']
'whitelisted_sender_emails': ['user@good-domain.tld', 'user@another-good-domain.tld']
'whitelisted_sender_ips': ['127.20.30.40', '192.168.0.0/16']
}