All URIs are relative to https://cpanel-server.tld:2083/execute
| Method | HTTP request | Description |
|---|---|---|
| add_list | GET /Email/add_list | Create mailing list |
| add_mailman_delegates | GET /Email/add_mailman_delegates | Add administrators to mailing list |
| count_lists | GET /Email/count_lists | Return cPanel account's mailing list total |
| delete_list | GET /Email/delete_list | Delete mailing list |
| export_lists | GET /Email/export_lists | Export cPanel account's Mailman mailing lists to a file |
| generate_mailman_otp | GET /Email/generate_mailman_otp | Create one-time password for a mailing list |
| get_lists_total_disk_usage | GET /Email/get_lists_total_disk_usage | Return cPanel account's mailing list disk usage |
| get_mailman_delegates | GET /Email/get_mailman_delegates | Return mailing list administrators |
| has_delegated_mailman_lists | GET /Email/has_delegated_mailman_lists | Return email account's mailing list privileges |
| list_lists | GET /Email/list_lists | Return cPanel account's mailing lists |
| passwd_list | GET /Email/passwd_list | Update mailing list password |
| remove_mailman_delegates | GET /Email/remove_mailman_delegates | Remove account mailing list admin privileges |
| set_list_privacy_options | GET /Email/set_list_privacy_options | Update mailing list privacy options |
InlineResponse200123 add_list(domain, list, password, private=private, rebuildonly=rebuildonly)
Create mailing list
This function creates a Mailman mailing list.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200123 import InlineResponse200123
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
domain = 'example.com' # str | The domain.
list = 'newlist' # str | The mailing list name.
password = '12345luggage' # str | The mailing list password.
private = 0 # int | Whether the mailing list is private. * `1` — Private. * `0` — Public. (optional) (default to 0)
rebuildonly = 0 # int | Whether to rebuild the mailing list. * `1` — Rebuild the mailing list. * `0` — Do **not** rebuild the mailing list. (optional) (default to 0)
try:
# Create mailing list
api_response = api_instance.add_list(domain, list, password, private=private, rebuildonly=rebuildonly)
print("The response of MailingListsApi->add_list:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->add_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| domain | str | The domain. | |
| list | str | The mailing list name. | |
| password | str | The mailing list password. | |
| private | int | Whether the mailing list is private. * `1` — Private. * `0` — Public. | [optional] [default to 0] |
| rebuildonly | int | Whether to rebuild the mailing list. * `1` — Rebuild the mailing list. * `0` — Do not rebuild the mailing list. | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200124 add_mailman_delegates(delegates, list)
Add administrators to mailing list
This function grants mailing list administrative privileges to users.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200124 import InlineResponse200124
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
delegates = 'delegates=user@example.com,admin@example.com' # str | A list of the administrators to add. **Note:** Separate multiple email addresses with commas.
list = 'mylist' # str | The mailing list.
try:
# Add administrators to mailing list
api_response = api_instance.add_mailman_delegates(delegates, list)
print("The response of MailingListsApi->add_mailman_delegates:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->add_mailman_delegates: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| delegates | str | A list of the administrators to add. Note: Separate multiple email addresses with commas. | |
| list | str | The mailing list. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200134 count_lists()
Return cPanel account's mailing list total
This function returns the number of mailing lists for every email address on a cPanel account.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200134 import InlineResponse200134
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
try:
# Return cPanel account's mailing list total
api_response = api_instance.count_lists()
print("The response of MailingListsApi->count_lists:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->count_lists: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200141 delete_list(list)
Delete mailing list
This function deletes a Mailman mailing list.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200141 import InlineResponse200141
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
list = 'mylist' # str | The mailing list.
try:
# Delete mailing list
api_response = api_instance.delete_list(list)
print("The response of MailingListsApi->delete_list:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->delete_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list | str | The mailing list. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200155 export_lists()
Export cPanel account's Mailman mailing lists to a file
This function exports a cPanel account's Mailman mailing lists into a CSV file. This file is located in mail/exported_lists under the user's home directory.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200155 import InlineResponse200155
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
try:
# Export cPanel account's Mailman mailing lists to a file
api_response = api_instance.export_lists()
print("The response of MailingListsApi->export_lists:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->export_lists: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200158 generate_mailman_otp(list)
Create one-time password for a mailing list
This function generates a one-time password (OTP) for a mailing list.
Note:
The generated password expires after one use.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200158 import InlineResponse200158
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
list = 'mylist' # str | The mailing list.
try:
# Create one-time password for a mailing list
api_response = api_instance.generate_mailman_otp(list)
print("The response of MailingListsApi->generate_mailman_otp:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->generate_mailman_otp: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list | str | The mailing list. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200167 get_lists_total_disk_usage()
Return cPanel account's mailing list disk usage
This function returns the total disk usage for the mailing lists of a cPanel account.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200167 import InlineResponse200167
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
try:
# Return cPanel account's mailing list disk usage
api_response = api_instance.get_lists_total_disk_usage()
print("The response of MailingListsApi->get_lists_total_disk_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->get_lists_total_disk_usage: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200169 get_mailman_delegates(list)
Return mailing list administrators
This function lists a mailing list's administrators.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200169 import InlineResponse200169
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
list = 'mylist' # str | The name of a Mailman mailing list on the cPanel account.
try:
# Return mailing list administrators
api_response = api_instance.get_mailman_delegates(list)
print("The response of MailingListsApi->get_mailman_delegates:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->get_mailman_delegates: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list | str | The name of a Mailman mailing list on the cPanel account. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200177 has_delegated_mailman_lists(delegate)
Return email account's mailing list privileges
This function checks an account's administrative privileges on mailing lists.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200177 import InlineResponse200177
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
delegate = 'user@example.com' # str | The email address.
try:
# Return email account's mailing list privileges
api_response = api_instance.has_delegated_mailman_lists(delegate)
print("The response of MailingListsApi->has_delegated_mailman_lists:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->has_delegated_mailman_lists: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| delegate | str | The email address. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200187 list_lists(domain=domain, regex=regex)
Return cPanel account's mailing lists
This function lists the account's Mailman mailing lists.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200187 import InlineResponse200187
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
domain = 'example.com' # str | The domain to query. If you do **not** use this parameter, the function lists mailing lists for all of the cPanel account's domains. (optional)
regex = 'user' # str | A [Perl Compatible Regular Expression (PCRE)](https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions) that filters the results. (optional)
try:
# Return cPanel account's mailing lists
api_response = api_instance.list_lists(domain=domain, regex=regex)
print("The response of MailingListsApi->list_lists:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->list_lists: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| domain | str | The domain to query. If you do not use this parameter, the function lists mailing lists for all of the cPanel account's domains. | [optional] |
| regex | str | A Perl Compatible Regular Expression (PCRE) that filters the results. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200193 passwd_list(list, password)
Update mailing list password
This function changes a mailing list's password.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200193 import InlineResponse200193
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
list = 'mylist@example.com' # str | The full name (including the domain) of a Mailman mailing list on the cPanel account.
password = '12345luggage' # str | The new password.
try:
# Update mailing list password
api_response = api_instance.passwd_list(list, password)
print("The response of MailingListsApi->passwd_list:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->passwd_list: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| list | str | The full name (including the domain) of a Mailman mailing list on the cPanel account. | |
| password | str | The new password. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200196 remove_mailman_delegates(delegates, list)
Remove account mailing list admin privileges
This function removes an account's mailing list administrative privileges.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200196 import InlineResponse200196
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
delegates = 'user@example.com,admin@example.com' # str | list of the administrators to remove.
list = 'mylist' # str | The mailing list.
try:
# Remove account mailing list admin privileges
api_response = api_instance.remove_mailman_delegates(delegates, list)
print("The response of MailingListsApi->remove_mailman_delegates:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->remove_mailman_delegates: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| delegates | str | list of the administrators to remove. | |
| list | str | The mailing list. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200200 set_list_privacy_options(advertised, archive_private, list, subscribe_policy)
Update mailing list privacy options
This function modifies a Mailman mailing list's privacy options.
Important:
When you disable the Receive Mail role, the system disables this function.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200200 import InlineResponse200200
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.MailingListsApi(api_client)
advertised = 1 # int | Whether the Mailman directory page displays the list. * `1` - Display. * `0` - Does **not** display.
archive_private = 1 # int | Whether the mailing list archive is private. * `1` - Private. * `0` - Public.
list = 'mylist' # str | The mailing list name.
subscribe_policy = 1 # int | The level of control that the mailing list administrator has over new subscribers. * `1` - Anyone can subscribe. The system sends a confirmation email. * `2` - The administrator **must** approve subscriptions. The system does **not** send a confirmation email. * `3` - The administrator **must** approve subscriptions. The system sends a confirmation email.
try:
# Update mailing list privacy options
api_response = api_instance.set_list_privacy_options(advertised, archive_private, list, subscribe_policy)
print("The response of MailingListsApi->set_list_privacy_options:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MailingListsApi->set_list_privacy_options: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| advertised | int | Whether the Mailman directory page displays the list. * `1` - Display. * `0` - Does not display. | |
| archive_private | int | Whether the mailing list archive is private. * `1` - Private. * `0` - Public. | |
| list | str | The mailing list name. | |
| subscribe_policy | int | The level of control that the mailing list administrator has over new subscribers. * `1` - Anyone can subscribe. The system sends a confirmation email. * `2` - The administrator must approve subscriptions. The system does not send a confirmation email. * `3` - The administrator must approve subscriptions. The system sends a confirmation email. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]