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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Use WHM API's from external server?

Discussion in 'cPanel Developers' started by ritzzsoni, Nov 20, 2016.

Tags:
  1. ritzzsoni

    ritzzsoni Registered

    Joined:
    Nov 20, 2016
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Website Owner
    I have my server "A" running on ruby on rails.

    My hosting server "B" has WHM installed on it.

    How can I use WHM's APIs to get some data about hosting server.

    For example I want to list all the domains and sub domains per user.

    Is it possible? if yes then how?

    Any suggestion.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, you can setup a custom script on the source server that connects to the cPanel server and utilizes WHM API 1 or UAPI functions. For example, this is a good WHM UAPI function to list domain names and subdomain names associated with an account:

    UAPI Functions - DomainInfo::list_domains - Software Development Kit - cPanel Documentation

    You may also find these documents helpful:

    Guide to UAPI - Software Development Kit - cPanel Documentation
    Guide to WHM API 1 - Software Development Kit - cPanel Documentation
    Guide to API Authentication - Software Development Kit - cPanel Documentation

    Thank you.
     
Loading...

Share This Page