Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Having problem with calling Api2 Module:ZoneEdit

Discussion in 'cPanel Developers' started by mysteryosly, Aug 21, 2012.

  1. mysteryosly

    mysteryosly Registered

    Joined:
    Aug 21, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    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.
     
  2. mysteryosly

    mysteryosly Registered

    Joined:
    Aug 21, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    bumpszeeers
     
  3. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    68
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    You need to remove the trailing space in the name of the function.

    Code:
    'remove_zone_record '
    
    should be

    Code:
    'remove_zone_record'
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice