The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using hooks + API

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

  1. Kyle J Hunter

    Kyle J Hunter Registered

    Feb 20, 2015
    Likes Received:
    Trophy Points:
    Melbourne, Victoria, Australia
    cPanel Access Level:
    Root Administrator

    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?

Share This Page