update_cronjob()
Update a cron job.
Signature
update_cronjob(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 |
|---|---|---|
cronjob_id |
The cron job ID to update | Required |
protocol |
Cron job protocol: http|https | Optional |
http_url |
The cron job URL | Optional |
cronjob_comment |
The cron job comment | Optional |
minute |
The minute to run: */1-59|0-59|* | Optional |
hour |
The hour to run: */1-23|1-23|* | Optional |
day_of_month |
The day of the month to run: 0-31|* | Optional |
month |
The month to run: * | Optional |
day_of_week |
The weekday to run: 0-7|* (Sunday = 0 or 7) | Optional |
http_user |
The HTTP authentication user | Optional |
http_password |
The HTTP authentication password | Optional |
mail_address |
The email address that receives the confirmation email, RFC 2822 | Optional |
mail_condition |
Condition word; if it appears in the script output, no email is sent | Optional |
mail_subject |
Use cronjob_comment as the email subject: default|comment | Optional |
is_active |
The cron job is active: Y|N | Optional |
PHP example
<?php
// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
'cronjob_id' => '123456',
'http_url' => 'example.com/cron2.php',
'minute' => '3',
'hour' => '2',
'day_of_month' => '*',
'month' => '*',
'day_of_week' => '3',
'cronjob_comment' => 'comment',
'http_user' => 'login',
'http_password' => 'password',
'mail_address' => 'cronjob@example.com',
'is_active' => 'N',
];
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_cronjob',
'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 -
cronjob_id_syntax_incorrect -
cronjob_not_found -
day_of_month_or_day_of_week_incorrect -
day_of_month_syntax_incorrect -
day_of_week_syntax_incorrect -
hour_syntax_incorrect -
http_password_syntax_incorrect -
protocol_syntax_incorrect -
http_url_syntax_incorrect -
http_user_syntax_incorrect -
is_active_syntax_incorrect -
mail_address_syntax_incorrect -
mail_condition_syntax_incorrect -
minute_syntax_incorrect -
month_syntax_incorrect -
time_not_allowed