Results 1 to 6 of 6

Thread: Problem with CMD_API_SHOW_ALL_USERS empty array

  1. #1
    Join Date
    Aug 2017
    Posts
    3

    Problem with CMD_API_SHOW_ALL_USERS empty array

    Hi,
    I'm learning DA API's for my project and i'm testing the simplies way to connect with my DA account (admin of course) for now.
    CMD_API_SHOW_USER_USAGE?user=user_name work fine, I can see nice array as a result.

    But second day i'm fighting with the CMD_API_SHOW_ALL_USERS command or CMD_API_SHOW_USERS or CMD_API_SHOW_USERS=?reseller=reseller_name
    I always get empty array as result: Array ( )
    I tried to connect with and without SSL, always same result empty array.

    I use simpliest code:
    PHP Code:
    $x file_get_contents('https://admin:password@www.da_adress.com:2223/CMD_API_SHOW_ALL_USERS'); 
    $y urldecode($x); 

    parse_str($y$output); 

    print 
    "<pre>";
    print_r($output);
    print 
    "</pre>"
    I tried connecting with httpsocket.php and connection was ok, but still same empty array.
    Of course on the server there are ~300 hosting accounts. Hosting providers tells me that tehy dont block any of apis commands and my account have all rights to api.
    I tried to print_r result before decoding and it was empty too for this commands. For command CMD_API_SHOW_USER_USAGE?user=user_name it was ok.

    Very strange thing, could some one can help me?

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    11,407
    Hello,

    What if you open https://www.da_adress.com:2223/CMD_API_SHOW_ALL_USERS in a browser after you authorized in Directadmin? What will you see?
    With regards, Alex.

    Professional Server Management for web hosting companies and individuals
    Hourly Support, Disaster Recovery, Server Hardening, Monthly Subscription
    Directadmin installation and optimization

    Click here if you need a Linux Admin

  3. #3
    Join Date
    Aug 2017
    Posts
    3
    Hi,
    page don't work:
    ERR_INVALID_HTTP_RESPONSE

    the command /CMD_API_SHOW_USER_USAGE?user=user_name i that method you said work fine for me, I get the response.

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    11,407
    You need to check directadmin logs then, probably they can give more information on the matter.
    With regards, Alex.

    Professional Server Management for web hosting companies and individuals
    Hourly Support, Disaster Recovery, Server Hardening, Monthly Subscription
    Directadmin installation and optimization

    Click here if you need a Linux Admin

  5. #5
    Join Date
    Aug 2017
    Posts
    3
    It turned out that my hosting provider blocks some API commands... Is it normal? I'm paying for VPS managed with DA licence... They explain them selves that the service is shared, and with this command I could get info about other users. And they don't want to delete this blockade.
    Is there some another command with i can get info about my users? I tried CMD_API_SHOW_USERS with reseler parameter, but I get that same: blank array.
    Of course my account is admin account so I don't understand this situation.

  6. #6
    Join Date
    Nov 2013
    Location
    Belgium
    Posts
    59
    Quote Originally Posted by birchoff View Post
    It turned out that my hosting provider blocks some API commands... Is it normal? I'm paying for VPS managed with DA licence... They explain them selves that the service is shared, and with this command I could get info about other users. And they don't want to delete this blockade.
    Is there some another command with i can get info about my users? I tried CMD_API_SHOW_USERS with reseler parameter, but I get that same: blank array.
    Of course my account is admin account so I don't understand this situation.
    If you are having a vps with your own Directadmin license it is not possible for you to see data from other vps owners on the server. So I don't know what your hosting provider is talking about, but it should be safe to have access to the full API.

    Best suggestion I could give us talk this over with your hosting company to find a solution.

    Regards,
    Niels

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •