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!

How to get a dictionary of values ​​"id user" => "domain" via javascript http request?

Discussion in 'cPanel Developers' started by gaika, Aug 5, 2014.

  1. gaika

    gaika Registered

    Joined:
    Aug 5, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    How to get a dictionary of values ​​"id user" => "domain" via javascript http request?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,429
    Likes Received:
    1,960
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Could you elaborate a little more on this question? For instance, what's the overall task you are seeking to accomplish?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPAndrewHodge

    cPAndrewHodge cPanel UI Developer
    Staff Member

    Joined:
    Dec 10, 2012
    Messages:
    52
    Likes Received:
    3
    Trophy Points:
    83
    cPanel Access Level:
    Root Administrator
    This is the closest API we have, you would just have to massage the data since it will return an array.

    http://documentation.cpanel.net/display/SDK/WHM+API+1+-+listaccts

    I recommend using the API Shell we provide in WHM, it will generate the partial API URL strings. In this case calling this api results in this string given:

    Code:
    /json-api/listaccts?api.version=1
    which if I want to see the results I just need to do this

    Code:
    www.myServerName.com:2087/cpsess123/json-api/listaccts?api.version=1
     
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