Get setting¶
Get settings for system mailer (used to send system emails), postfix relayhost, junk/trash clearing interval and IMAP master password
- HTTP Method:
GET
- URL:
https://example.domain.tld/api/v1/settings/<setting>/
- Require authentication:
Yes
- Permission level required:
MasterAdmin
Path parameters¶
Parameter | Type | Description | Required |
---|---|---|---|
setting | str | system_mailer or postfix_relayhost or junk_trash_clearing_interval or imap_master_password |
Required |
Response parameters¶
Parameter | Type | Description |
---|---|---|
settings | dict | The settings object |
name | str | Setting name |
status | str | Status |
value | str / dict | Value of setting |
Tip
Response would be HTTP 204 NO CONTENT
(empty string) if the setting does not exist, i.e., was never set/updated.
Example request (Python)¶
import requests
import json
from pprint import pprint
url = "https://example.domain.tld/api/v1/settings/postfix_relayhost/"
r = requests.get(url, auth=("admin","long-auth_token-here"))
try:
pprint(r.json())
except:
print(r.text)
Example response (JSON)¶
{'settings': {'name': 'postfix_relayhost',
'status': 'applied',
'value': {'server_hostname': 'filter1020.mymailcheap.com',
'server_port': 587,
'username': 'relay-user'}}}