update_mailinglist()

Update a mailing list.

All API functions Mailing List

Signature

update_mailinglist(array $parameters): mixed

Parameters

Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.

Name Description Requirement
mailinglist_name The mailing list to update Required
subscriber The list subscribers, RFC 2822; separate multiple subscribers with line breaks Optional
restrict_post The restrict post addresses, RFC 2822; separate multiple addresses with line breaks Optional
config The complete configuration file as plain text Required
is_active The mailing list is active: Y|N Optional

PHP example

<?php

// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
    'mailinglist_name' => 'my_mailinglist',
    'subscriber' => 'subscriber@example.tld',
    'restrict_post' => 'poster@example.tld',
    'is_active' => 'Y',
];

try {
    $client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
    $response = $client->KasApi(json_encode([
        'kas_login' => 'w0123456',
        'kas_auth_type' => 'session',
        'kas_auth_data' => $sessionToken,
        'kas_action' => 'update_mailinglist',
        'KasRequestParams' => $parameters,
    ]));
    print_r($response);
} catch (SoapFault $fault) {
    echo 'Error: ' . $fault->faultstring;
}

Responses and error codes

  • TRUE the action was carried out
  • missing_parameter a required parameter is missing
  • in_progress the KAS object is currently being processed
  • cannot_connect_to_majordomo
  • cannot_login_to_majordomo
  • cannot_open_tmp_config
  • cannot_open_tmp_restrict_post
  • cannot_open_tmp_subscriber
  • cannot_write_tmp_config
  • cannot_write_tmp_restrict_post
  • cannot_write_tmp_subscriber
  • cannot_write_to_majordomo
  • is_active_syntax_incorrect
  • mailinglist_not_found
  • mailinglist_syntax_incorrect
  • parse_error_in_tmp_config
  • restrict_post_email_syntax_incorrect
  • subscriber_email_syntax_incorrect