Function: cronjobsusers
To make use of the ‘del‘ Action, the following parameters must be sent:
-
- key: Key authorized by Api administrator
- action: del
- user: User owners of the scheduled tasks
- execute: Frequency with which to execute the cron Example: * * * * * *
- command: Command to execute, Example: /usr/bin/php test.php
– Possible answers:
-
- status -> OK
- status -> Error, msj -> All data is required
Example of code in php
$data = array(“key” => “MYKEY”,”action”=>’del’, ”user”=>’USER’, ”execute”=>’ * * * * * *’, ”command”=>’echo "hi" >> test.txt’); $url = “https://IPSERVERAPI:2304/v1/cronjobsusers”; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt ($ch, CURLOPT_POST, 1); $response = curl_exec($ch); curl_close($ch);