Open API

Basic Information
Introduction
Start

General
File Status Check

Accounts
Authentication
getAccountInformation

Upload
maxFileSize
getFileserver
resumeFile
uploadFile

RemoteUpload
maxRemoteUploads
addRemoteUpload
remoteUploadStatus

Folders
getFolders
newFolder
renameFolder
moveFolder
removeFolder

Files
getFiles
renameFile
moveFile
copyFile
removeFile
encodeFile
restartEncodeFile

Basic Information


Introduction

With the BitShare.com API, you can develop your application for Smartphones (e.g. iPhone, Android, Symbian, Blackberry, Windows Phone), tablet computers, Windows, Mac, and Linux today. Most functions provided via our website can be used with this API. Moreover, it's totally free to us our API - without any restrictions!


Please see the documentation below for further details and examples.

Start

The API is based on simple POST-Actions. See the single actions for paramters, return results and documentation. Please find the general message structure below.


Sucessful actions:
SUCCESS:[RETURN]
Errors:
ERROR:[ERRORMESSAGE]


General


File Status Check

POST => http://bitshare.com/api/openapi/general.php
Parameters:
(string) action => "getFileStatus"
(string) files => File links seperated by a new line
Result:
[link]#[status]#[hash]#[name]#[filesize]

One line foreach file (separated by "\r\n")

(string) [link] => Given file link (without http:// and www.)
(string) [status] => 'offline' or 'online'
(string) [hash] => File's unique hash ID
(string) [name] => File's name
(int) [filesize] => filesize in bytes (0 => offline files)

Accounts


Authentication

POST => http://bitshare.com/api/openapi/login.php
Parameters:
(string) user
(string) password (as md5-hash)
Result:
SUCCESS:[hashkey]

(string) [hashkey] => Unique login hash, which is used for further API actions

getAccountInformation

POST => http://bitshare.com/api/openapi/accountdetails.php
Parameters:
(string) hashkey
Result:
SUCCESS:[premiuminfo]#[files count]#[file space]#[folders count]

(int) [premiuminfo] => 1 or 0
(int) [files count] => Number of user's files
(int) [file space] => Used space in bytes by user's files
(int) [folders count] => Number of user's folders

Upload


maxFileSize

POST => http://bitshare.com/api/openapi/upload.php
Parameters:
(string) action => "maxFileSize"
(string) hashkey
Result:
SUCCESS:[max. filesize]#[max. entries]

(int) [max. filesize] => Maximum file size to upload
(int) [max. entries] => Maximum number of remoteupload urls to post

getFileserver

POST => http://bitshare.com/api/openapi/upload.php
Parameters:
(string) action => "getFileserver"
Result:
SUCCESS:[fileserver url]

(string) [fileserver url] => URL for file upload

resumeFile

POST => http://bitshare.com/api/openapi/upload.php
Parameters:
(string) action => "resumeFile"
(string) hashkey
(string) filename
(int) filesize
Result:
SUCCESS:[resume ID]#[file size]#[fileserver url]

(int) [resume ID] => Unique resume ID to continue existing upload
(int) [file size] => Size of the existing part of the file which is going to be resumed
(string) [fileserver url] => URL for file upload

uploadFile

POST => [fileserver url]
Parameters:
(file) file (post only one file as a "multipart/form-data" form)
(string) hashkey
(int) filesize (original filesize in bytes => to check if file was uploaded successfully)
[optional] (int) resume ID
Result:
SUCCESS:[downloadlink]#[bblink]#[htmllink]#[shortlink]#[deletelink]#[file_id]

(string) [downloadlink] => Regular download link
(string) [bblink] => Regular download link in BB-Code format
(string) [htmllink] => Regular download link in HTML format
(string) [shortlink] => Short download link
(string) [deletelink] => Delete link
(int) [file_id] => Delete link

RemoteUpload


maxRemoteUploads

POST => http://bitshare.com/api/openapi/upload.php
Parameters:
(string) action => "maxRemoteUploads"
(string) hashkey
Result:
SUCCESS:[max. entries]

(int) [max. entries] => Maximum number of remoteupload urls to post

addRemoteUpload

POST => http://bitshare.com/api/openapi/upload.php
Parameters:
(string) action => "addRemoteUpload"
(string) hashkey
(string) url (URL to upload)
[optional] (string) notification_mail => Provide e-mail and subject for notification messages
[optional] (string) notification_subject
Result:
SUCCESS:[key]

(string) [key] => Unique key to identify remoteupload

remoteUploadStatus

POST => http://bitshare.com/api/openapi/upload.php
Parameters:
(string) action => "remoteUploadStatus"
(string) hashkey
(string) key (unique remoteupload key)
Result:
SUCCESS:[status]#[statusdetails]

(string) [status] => Remoteupload's status ("Pending", "Processing", "Downloading", "Finished" or "Failed")
[optional] (string) [statusdetails] => e.g. download details or download link

Folders


getFolders

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "getfolders"
(string) hashkey
Result:
One folder per line:
FOLDER_ID#FOLDER_NAME#PARENT_FOLDER_ID#FOLDER_LINK#INDENTED_FOLDER_NAME

newFolder

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "newfolder"
(string) hashkey
(string) foldername
(int) mainfolder => Parent folder ID (0 = root)
Result:
SUCCESS:FOLDER_ID

renameFolder

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "renamefolder"
(string) hashkey
(string) foldername
(int) folder => folder ID
Result:
SUCCESS:Folder has been renamed!

moveFolder

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "movefolder"
(string) hashkey
(int) folder => folder ID
(int) mainfolder => Parent folder ID (0 = root)
Result:
SUCCESS:Folder has been moved!

removeFolder

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "removefolder"
(string) hashkey
(int) folder => folder ID
Result:
SUCCESS:Folder has been removed successfully!

Files


getFiles

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "getfiles"
(string) hashkey (int) mainfolder => folder ID (0 = root)
Result:
One file per line:
FILE_ID#FILE_NAME#FILE_SIZE#FILE_DATE#FILE_DOWNLOADS#FILE_DOWNLOAD_LINK#
FILE_BB_CODE_LINK#FILE_HTML_LINK#FILE_SHORT_LINK#FILE_DELETE_LINK

renameFile

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "renamefile"
(string) hashkey
(string) name => new file name
(int) file => file ID
Result:
SUCCESS:File has been renamed!

moveFile

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "movefile"
(string) hashkey
(int) file => file ID
(int) mainfolder => Parent folder ID (0 = root)
Result:
SUCCESS:File has been moved!

copyFile

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "copyfile"
(string) hashkey
(int) file => file ID (int) mainfolder => Parent folder ID (0 = root)
Result:
SUCCESS:File has been copied!

removeFile

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "removefile"
(string) hashkey
(int) file => file ID
Result:
SUCCESS:File has been deleted!

encodeFile

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "encodefile"
(string) hashkey
(int) file => file ID
Result:
SUCCESS:Queued for encoding process!

restartEncodeFile

POST => http://bitshare.com/api/openapi/filestructure.php
Parameters:
(string) action => "restartencodefile"
(string) hashkey
(int) file => file ID
Result:
SUCCESS:Encoding process restarted!

Site
About BitShare
Help & Support