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!

Using hooks + API

Discussion in 'cPanel Developers' started by Kyle J Hunter, Mar 3, 2015.

  1. Kyle J Hunter

    Kyle J Hunter Registered

    Joined:
    Feb 20, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Melbourne, Victoria, Australia
    cPanel Access Level:
    Root Administrator
    Hey,

    I've created a hook in PHP for several cPanel API functions such as: Api2::AddonDomain::addaddondomain and Api2::Park::park, that part is working fine and will run when a user adds an addon domain or parked domain.

    The problem I'm having is how do I access the WHM/cPanel API from inside my hook, since the hook runs as the cPanel user I'm unable to access the .accesshash file and I need this script to make dome DNS zone changes for the domains.

    I've looked through the documentation and I'm not seeing anything useful, has anyone else had this issue?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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