update_mailforward()
Update a mail forward.
Signature
update_mailforward(array $parameters): mixedParameters
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 |
|---|---|---|
mail_forward |
The mail forward to update | Required |
target_N |
The forwarding targets, RFC 2822; N is a sequential number | Optional |
PHP example
<?php
// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
'mail_forward' => 'forward@example.com',
'target_0' => 'target0@example.com',
'target_1' => 'target1@example.com',
];
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_mailforward',
'KasRequestParams' => $parameters,
]));
print_r($response);
} catch (SoapFault $fault) {
echo 'Error: ' . $fault->faultstring;
}
Responses and error codes
-
TRUEthe action was carried out -
missing_parametera required parameter is missing -
in_progressthe KAS object is currently being processed -
nothing_to_donothing was changed -
mail_forward_adress_syntax_incorrect -
mail_forward_not_found -
mail_loop_detected -
target_email_duplicate -
target_email_like_forward -
target_email_syntax_incorrect -
targets_limit_reached