ByteSized-api

From Bytesized Wiki

(Difference between revisions)
Jump to: navigation, search
m (Changed protection level for "ByteSized-api" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
(Fixed minor changes and updated it with the news item and web ui updates)
Line 18: Line 18:
<user>  
<user>  
   <login>Animazing</login>  
   <login>Animazing</login>  
-
   <balance type="float">10</balance>  
+
   <balance type="float">10</balance>
 +
  <news_items type="array">
 +
    <!-- Additional news items removed from this wiki page for sake of simplicity //-->
 +
    <news_item>
 +
      <title>Hekatonheires and Zephyrus are currently down</title>
 +
      <body>
 +
        <![CDATA[[edit]
 +
 
 +
Heka was never offline, just Zeph. Everything back to normal
 +
[/edit]
 +
 
 +
Hekatonheires and Zephyrus are both currently down at the moment. No idea as to why. Stay tuned for updates.]]>
 +
 
 +
      </body>
 +
      <author>Animazing</author>
 +
    </news_item>
 +
  </news_items>
   <shared_accounts type="array">  
   <shared_accounts type="array">  
     <shared_account>  
     <shared_account>  
Line 30: Line 46:
       <paid_till type="datetime">2011-04-11</paid_till>  
       <paid_till type="datetime">2011-04-11</paid_till>  
       <web_vnc_link>http://notexistios.bytesized-hosting.com:5830</web_vnc_link>  
       <web_vnc_link>http://notexistios.bytesized-hosting.com:5830</web_vnc_link>  
 +
      <web_ui_link>http://notexistios.bytesized-hosting.com:34567</web_ui_link>
       <upgrade_available>true</upgrade_available>  
       <upgrade_available>true</upgrade_available>  
     </shared_account>  
     </shared_account>  
     <shared_account>  
     <shared_account>  
-
       <server_name>alsonotexitios</server_name>  
+
       <server_name>alsonotexistios</server_name>  
       <cached_quota>177.3143</cached_quota>  
       <cached_quota>177.3143</cached_quota>  
       <percentage_quota>80.5954545454545</percentage_quota>  
       <percentage_quota>80.5954545454545</percentage_quota>  
Line 41: Line 58:
       <days_till_deletion>70</days_till_deletion>  
       <days_till_deletion>70</days_till_deletion>  
       <paid_till type="datetime">2011-06-24</paid_till>  
       <paid_till type="datetime">2011-06-24</paid_till>  
-
       <web_vnc_link>http://alsonotexitios.bytesized-hosting.com:5823</web_vnc_link>  
+
       <web_vnc_link>http://alsonotexistios.bytesized-hosting.com:5823</web_vnc_link>
 +
      <web_ui_link>http://alsonotexistios.bytesized-hosting.com:34560</web_ui_link>
       <upgrade_available>false</upgrade_available>  
       <upgrade_available>false</upgrade_available>  
     </shared_account>  
     </shared_account>  
Line 48: Line 66:
</syntaxhighlight>
</syntaxhighlight>
-
Let's go over the different tags.
 
-
{|border="1" cellspacing="0" cellpadding="3"
+
 
 +
{|border="1" cellspacing="0" cellpadding="3" width="100%"
 +
| colspan="4" style="padding-top:25px; padding-bottom:25px;" | Let's go over the different tags.
 +
|-
!Attribute
!Attribute
!Description
!Description
Line 65: Line 85:
|float
|float
|13.50
|13.50
 +
|-
 +
|news_items
 +
|root element for each news_item array
 +
|array
 +
|
|-
|-
|shared_accounts
|shared_accounts
-
|root element for shared_account information
+
|root element for each shared_account array
|array
|array
|
|
 +
|-
 +
| colspan="4" style="padding-top:25px; padding-bottom:25px;" | For each news item, there is a news_item element in the news_items array. In each, there are the following tags:
 +
|-
 +
!Attribute
 +
!Description
 +
!Type
 +
!Example
 +
|-
 +
|title
 +
|The title of this news item
 +
|string
 +
|Hekatonheires and Zephyrus are currently down
 +
|-
 +
|body
 +
|The contents of the news item. This is wrapped in CDATA tags.
 +
|string
 +
|Heka was never offline.........
 +
|-
 +
|author
 +
|The admin who posted the news item
 +
|string
 +
|Animazing
 +
|-
 +
| colspan="4" style="padding-top:25px; padding-bottom:25px;" | For each account, there is an account element in the accounts array. In each, there are the following tags:
 +
|-
 +
!Attribute
 +
!Description
 +
!Type
 +
!Example
|-
|-
|server_name
|server_name
|name of the server for this account
|name of the server for this account
|string
|string
-
|hekantonkheires
+
|alsonotexistios
|-
|-
|cached_quota
|cached_quota
Line 84: Line 138:
|Percentage of disk-space used
|Percentage of disk-space used
|float
|float
-
|82.55
+
|80.5954545454545
|-
|-
|live_quota
|live_quota
Line 99: Line 153:
|Hard diskspace limit for this account
|Hard diskspace limit for this account
|integer
|integer
-
|241
+
|242
|-
|-
|days_till_deletion
|days_till_deletion
|Days until this account will be disabled
|Days until this account will be disabled
|integer
|integer
-
|12
+
|5
|-
|-
|paid_till
|paid_till
|Date until this account will be disabled
|Date until this account will be disabled
|date(time)
|date(time)
-
|2011-01-24
+
|2011-04-11
|-
|-
|web_vnc_link
|web_vnc_link
Line 115: Line 169:
|string
|string
|http://alsonotexitios.bytesized-hosting.com:5823
|http://alsonotexitios.bytesized-hosting.com:5823
 +
|-
 +
|web_ui_link
 +
|Link to this users web UI
 +
|string
 +
|http://alsonotexitios.bytesized-hosting.com:34560
|-
|-
|upgrade_available
|upgrade_available

Revision as of 14:39, 27 April 2011

Contents

ByteSized API

Introduction

The ByteSized API enables you as member to get all kinds of information from your account in an a neatly presented XML document. This makes it easy to build third party applications to display this data. We build it for our Google Chrome extension but you can use it for any other app you would like.

Connecting

http://bytesized-hosting.com/api/profile should be used as the URL to connect to our API. It requires one parameter, (one of) your API-Key(s).

In example: http://bytesized-hosting.com/api/profile?api_key=50b45a8fdded2e804cbf360b24951726fc33006f

XML

This is an example of what could be returned by our API.

<?xml version="1.0" encoding="UTF-8"?> 
<user> 
  <login>Animazing</login> 
  <balance type="float">10</balance>
  <news_items type="array">
    <!-- Additional news items removed from this wiki page for sake of simplicity //-->
    <news_item>
      <title>Hekatonheires and Zephyrus are currently down</title>
      <body>
        <![CDATA[[edit]
 
Heka was never offline, just Zeph. Everything back to normal
[/edit]
 
Hekatonheires and Zephyrus are both currently down at the moment. No idea as to why. Stay tuned for updates.]]>
 
      </body>
      <author>Animazing</author>
    </news_item>
  </news_items>
  <shared_accounts type="array"> 
    <shared_account> 
      <server_name>notexistios</server_name> 
      <cached_quota>10</cached_quota> 
      <percentage_quota>5</percentage_quota> 
      <live_quota>90GB / 110GB</live_quota> 
      <soft_quota>110</soft_quota> 
      <hard_quota>121.0</hard_quota> 
      <days_till_deletion>5</days_till_deletion> 
      <paid_till type="datetime">2011-04-11</paid_till> 
      <web_vnc_link>http://notexistios.bytesized-hosting.com:5830</web_vnc_link> 
      <web_ui_link>http://notexistios.bytesized-hosting.com:34567</web_ui_link>
      <upgrade_available>true</upgrade_available> 
    </shared_account> 
    <shared_account> 
      <server_name>alsonotexistios</server_name> 
      <cached_quota>177.3143</cached_quota> 
      <percentage_quota>80.5954545454545</percentage_quota> 
      <live_quota>177.31GB / 220GB</live_quota> 
      <soft_quota>220</soft_quota> 
      <hard_quota>242.0</hard_quota> 
      <days_till_deletion>70</days_till_deletion> 
      <paid_till type="datetime">2011-06-24</paid_till> 
      <web_vnc_link>http://alsonotexistios.bytesized-hosting.com:5823</web_vnc_link> 
      <web_ui_link>http://alsonotexistios.bytesized-hosting.com:34560</web_ui_link>
      <upgrade_available>false</upgrade_available> 
    </shared_account> 
  </shared_accounts> 
</user>


Let's go over the different tags.
Attribute Description Type Example
login The username matching the given API-key string Animazing
balance Current account balance float 13.50
news_items root element for each news_item array array
shared_accounts root element for each shared_account array array
For each news item, there is a news_item element in the news_items array. In each, there are the following tags:
Attribute Description Type Example
title The title of this news item string Hekatonheires and Zephyrus are currently down
body The contents of the news item. This is wrapped in CDATA tags. string Heka was never offline.........
author The admin who posted the news item string Animazing
For each account, there is an account element in the accounts array. In each, there are the following tags:
Attribute Description Type Example
server_name name of the server for this account string alsonotexistios
cached_quota Amount of diskspace used when last checked on server float 177.3143
percentage_quota Percentage of disk-space used float 80.5954545454545
live_quota Diskspace used at this moment returns cached if the server could not be reached. string 177.31GB / 220GB
soft_quota Soft diskspace limit for this account integer 220
hard_quota Hard diskspace limit for this account integer 242
days_till_deletion Days until this account will be disabled integer 5
paid_till Date until this account will be disabled date(time) 2011-04-11
web_vnc_link Link to this users web-based VNC server string http://alsonotexitios.bytesized-hosting.com:5823
web_ui_link Link to this users web UI string http://alsonotexitios.bytesized-hosting.com:34560
upgrade_available Is it possible to upgrade this account to the next plan boolean true

The API is bound to be changed but existing data should always be presented as is now, major versions will have a new URL to accompany them.

Personal tools