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.

API for suspending reseller account including clients

Discussion in 'cPanel Developers' started by vivekvsist, Feb 10, 2009.

  1. vivekvsist

    vivekvsist Active Member

    Joined:
    May 29, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Hi there

    I was not able to find such an API

    I want to suspend the whole reseller accounts.

    Reseller A
    client A1
    client A2
    client A3


    I want to suspend these all accounts. How can I do this with API ?
     
  2. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Vivek,
    This is not something that can be done in a single command, however it is easy enough to do:

    pseudocode:
    Code:
    $resellerinfo = xmlin( GEThttp://ip:2086/xml-api/resellerstats?reseller=$reseller)
    
    foreach $acct ($resellerinfo->{result}->{accts} ) {
     GET http://ip:2086/xml-api/suspendacct?user=$acct->{user}
    }
    GET http://ip:2086/xml-api/suspendacct?user=$reseller
    
     
    #2 MattDees, Feb 10, 2009
    Last edited: Feb 10, 2009
  3. vivekvsist

    vivekvsist Active Member

    Joined:
    May 29, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    But I think this is something easy

    $request = "/scripts/suspendreseller?resalso=1&reseller=$uname";
     
  4. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    That wouldn't be through our APIs however - that can be done :)
     
Loading...

Share This Page