Skip to main content

cPanel API access from hook with WHM 74?

Comments

2 comments

  • tizoo
    Hi all, I finally found the answer after reading many different posts, but not in the cPanel documentation... use Cpanel::API; my $res = Cpanel::API::execute( 'Email', 'add_pop', { 'domain' => $domain, 'email' => $user, 'password_hash' => '$6$...', 'quota' => '500', 'skip_update_db' => 1, 'send_welcome_email' => 0 } ); $logger->info(Data::Dumper::Dumper($res));
    But one question is still not answered... Is it the right way to do it ? Hope this helps those who will have the same problem. Philippe
    0
  • cPanelMichael
    Hello @tizoo, You'll need to ensure your script makes use of the JSON output instead. We document an example of this at: UAPI - Return Data - Developer Documentation - cPanel Documentation Feel free to test out the custom code noted in your last response and let us know if you encounter any issues. Thank you.
    0

Please sign in to leave a comment.