Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Default Bandwidth in XML API

    Hi there

    What .xml file is the bandwidth displayed on using the XML API? It is not displayed in accountsummary xml file.

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by Andrewcp View Post
    Hi there

    What .xml file is the bandwidth displayed on using the XML API? It is not displayed in accountsummary xml file.
    .../xml-api/showbw

  3. #3
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by Andrewcp View Post
    Thanks very much David.

    What are the variables in .../xml-api/showbw? For example like the account summary xml file.

    <accountsummary>
    <acct>
    <disklimit>1000M</disklimit>
    </acct>

    It’s just I don't have access to cPanel and I am trying to write a script that parses the xml.

    Thanks very much.
    The contents of showbw look like the following:

    HTML Code:
    <acct>
      <deleted>0</deleted>
      <limit>BANDWIDTH-LIMIT-IN-BYTES</limit>
      <maindomain>MAIN-DOMAIN</maindomain>
      <owner>OWNER-OF-ACCOUNT</owner>
      <reseller>0 OR 1</reseller>
      <totalbytes>NUMBER-OF-BYTES-TRANSFERRED</totalbytes>
      <user>USERNAME</user>
    </acct>

  4. #4
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Default

    Thanks very much David.

    What are the variables in .../xml-api/showbw? For example like the account summary xml file.

    <accountsummary>
    <acct>
    <disklimit>1000M</disklimit>
    </acct>

    It’s just I don't have access to cPanel and I am trying to write a script that parses the xml.

    Thanks very much.

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Default

    Thanks

    Can the xml be called by xml-api/showbw?user=xxxxx?

  6. #6
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by Andrewcp View Post
    Thanks

    Can the xml be called by xml-api/showbw?user=xxxxx?
    To display the bandwidth consumption for an individual user, you would use:

    Code:
    xml-api/showbw?search=USERNAME&searchtype=user
    In this example, USERNAME is the user whose bandwidth information I desire.

  7. #7
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Default

    This there a date variable in showbw? For some reason 2009 is being displayed?

  8. #8
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by Andrewcp View Post
    This there a date variable in showbw? For some reason 2009 is being displayed?
    You mean 2009 is being displayed in the year tag, just like 3 is currently displayed in the month tag, indicating which month this bandwidth data is for?

    Yes, you can set month=MONTH_NUMBER and year=YEAR as GET parameters.
    - YEAR is a 4-digit year (e.g. 2008)
    - MONTH_NUMBER is a number representing a month (1 representing January .. 12 representing December).

  9. #9
    Registered User
    Join Date
    May 2009
    Posts
    2

    Default

    Quote Originally Posted by cPanelDavidG View Post
    You mean 2009 is being displayed in the year tag, just like 3 is currently displayed in the month tag, indicating which month this bandwidth data is for?

    Yes, you can set month=MONTH_NUMBER and year=YEAR as GET parameters.
    - YEAR is a 4-digit year (e.g. 2008)
    - MONTH_NUMBER is a number representing a month (1 representing January .. 12 representing December).
    Hi,there.Can i set day as GET parameters?
    How can I get the daily bandwidth with the XML-API?
    Last edited by xfoxx; 05-28-2009 at 01:49 AM.

  10. #10
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by xfoxx View Post
    Hi,there.Can i set day as GET parameters?
    How can I get the daily bandwidth with the XML-API?
    WHM does not generate daily bandwidth reports. Therefore, since WHM doesn't have this function - there is no API to access such information.

  11. #11
    Registered User
    Join Date
    May 2009
    Posts
    2

    Default

    Quote Originally Posted by cPanelDavidG View Post
    WHM does not generate daily bandwidth reports. Therefore, since WHM doesn't have this function - there is no API to access such information.
    It's bad ,but thahks for your answer.I have one more, can i change the quota without using scripts/editquota.

  12. #12
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by xfoxx View Post
    It's bad ,but thahks for your answer.I have one more, can i change the quota without using scripts/editquota.
    At this time, cPanel user quota modification is not available in our XML API except by means of changing the package associated with that account.

Similar Threads & Tags
Similar threads

  1. xml-api bandwidth
    By hbidad in forum cPanel Developers
    Replies: 2
    Last Post: 04-03-2011, 09:41 AM
  2. Replies: 2
    Last Post: 06-14-2010, 07:17 AM
  3. Replies: 3
    Last Post: 10-22-2009, 11:40 AM
  4. XML-API is any of these possible?
    By neo4242002 in forum cPanel Developers
    Replies: 3
    Last Post: 03-17-2008, 02:46 PM
  5. XML API: always get login screen, not XML
    By sldff3ald in forum cPanel Developers
    Replies: 3
    Last Post: 09-19-2007, 10:29 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube