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.

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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

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

    Thank you.
     
  3. cPAndrewHodge

    cPAndrewHodge cPanel UI Developer
    Staff Member

    Joined:
    Dec 10, 2012
    Messages:
    52
    Likes Received:
    3
    Trophy Points:
    8
    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
     

Share This Page