Having problem with calling Api2 Module:ZoneEdit

mysteryosly

Registered
Aug 21, 2012
2
0
1
cPanel Access Level
Website Owner
Hello , im currently trying to call api2 module ZoneEdit function remove/add_zone_record but im getting the following error:
[ZoneEdit::remove_zone_record ] Encountered error in ZoneEdit::remove_zone_record : API2: Could not locate function Cpanel::ZoneEdit::api2_remove_zone_record !
_______________________________________________________________
Encountered error in ZoneEdit::add_zone_record : API2: Could not locate function Cpanel::ZoneEdit::api2_add_zone_record !
warn [cpanel] Unable to run [Cpanel::ZoneEdit::api2_remove_zone_record (2/8)]; () at /usr/local/cpanel/Cpanel/Api2/Exec.pm line 115
__________________________________________________
I've tried this little plugin in an older cpanel version it worked , without problems to add and remove zone records .
Currently im testing this on the latest cpanel version : 11.32.3 (build 23) and im getting those errors .
Could you gimme some orientation , what can i be doing wrong ?
I am testing this with normal account , that have DNS editors (simple/advanced) enabled . Yet in my plugin i cant execute those commands .

I am using livephp for calls .
A view of my call :
$cpanel = new CPANEL();
$cpanel->api2('ZoneEdit','remove_zone_record ',array("domain"=>"$domain","line"=>"$line"));
$cpanel->api2('ZoneEdit','add_zone_record',array("domain"=>"$domain","name"=>"$newrecord_name","type"=>"$type","ttl"=>"$ttl","$address_var"=>"$address","class"=>"IN"));

Thanks in advance.
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
San Francisco, CA
cPanel Access Level
Root Administrator
Code:
$cpanel->api2('ZoneEdit','remove_zone_record ',array("domain"=>"$domain","line"=>"$line"));
You need to remove the trailing space in the name of the function.

Code:
'remove_zone_record '
should be

Code:
'remove_zone_record'