Overview

Bithub mainly consists of two types of objects: Shares and files. Shares are a simple a collection of files. A single share is associated with one or more users.

The API lets you access those shares and files by using simple vanilla XML requests over HTTP. Authentication is done via basic HTTP authorization.

A sample XML request could look like: POST / HTTP/1.1 Host: bithub.net Authorization: Basic d2lraTpwZWRpYQ==:d2lraTpwZWRpYQ== Content-Type: application/xml <request> <type>listshares</type> </request> Pretty simple, mh?

List available shares

The API request is simple as: <request> <type>listshares</type> </reuqest> The bithub.net response has the following format: <?xml version='1.0' standalone='yes'?> <shares type="array"> <share type="array"> <name type="string">[THE NAME OF THE SHARE]</name> <id type="integer">[UNIQUE NUMBER ASSOCIATED WITH THE SHARE]</id> </share> <share>  ... </share> </shares> Every share is uniquely identified by a number, which is called "id". With that id you are able to query the API to retrieve the contents of a share.

List contents of a share

Request: <request> <type>listfiles</type> <id>[UNIQE ID OF THE SHARE YOU WANT TO ACCESS]</id> </request> Response: <files type="array"> <file type="array"> <filename type="string">[NAME OF THE FILE]</filename> <id type="integer">[UNIQE FILE ID]</id> <token type="string">[RANDOM MD5 STRING]</token> <lastmodified type="string">[DATE OF LAST MODIFICATION]</lastmodified> </file> <file> ... </file> </files>

Download a file

To download a file, just call the following Page: http://bithub.com/download/[FILE ID]/[SECURITY TOKEN] Don't forget to include your authentification data.

Update modified file

Just post your file to the following URL: http://www.bithub.net/update/[FILE ID] Include basic HTTP-authentication and the file contents in the post-field "upload".

Got questions?

If you got trouble with the bithub-API or suggestions for improvement, drop an email at info@bithub.net.