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.

Showing Bandwidth Usage for users without WHM access

Discussion in 'cPanel Developers' started by paulfraser, May 23, 2010.

  1. paulfraser

    paulfraser Member

    Joined:
    Jun 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Scotland, UK
    Hello,

    I have been creating some mashups with the cPanel XML API this past week, I uderstand how it works (and it works well!) however i've searched the forum for the answer to my question, which although there are many questions regarding it, nothing answers it directly.

    I am able to retrieve specific bandwidth details per account using showbw parameter while logged in as WHM, however, am i able to use cPanel login credentials to get individual bandwidth data for each account, for example;

    say i have an account set up: example.com - username: example,
    Am i able to do something along the lines of:

    Code:
    https://webhost.com:2082/json-api/showbw?search=example&searchtype=user
    Which returns details regarding that account, much like the WHM way?

    Thanks in advance.
     
  2. paulfraser

    paulfraser Member

    Joined:
    Jun 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Scotland, UK
  3. 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
    A cpanel version of your mashup would be very nice to see.

    Anyways, what you probably want is the StatsBar::stat function to do this:

    ApiStatsBar < ApiDocs/Api2 < TWiki

    You can use this in conjunction with the cPanel XML-API call to get the information you need, e.g:

    /xml-api/cpanel?cpanel_xmlapi_module=StatBar&cpanel_xmlapi_func=stat&display=diskusage
     
    #3 MattDees, May 24, 2010
    Last edited: May 24, 2010
  4. paulfraser

    paulfraser Member

    Joined:
    Jun 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Scotland, UK
    amazing :] just what i was looking for, thanks Matt!
     
Loading...

Share This Page