Functions


accept_terms

activate

add_file_comment

add_file_comment_vote

add_file_vote

add_user_message

billing_country

billing_details

billing_details_from_ares

billing_details_from_vies

billing_payments

cancel_upload

clear_file_password

clear_history

confirm_sms_payment

create_folder

dequeue_file

file_comments

file_exists

file_info

file_link

file_password_salt

file_protected

files

folder

folder_link

help

history

login

logout

logout_all_devices

logout_other_devices

move_file

news

payment

queue

queue_file

register

remote_upload

remove_file

rename_file

reset_password

running_downloads

salt

search

send_activation_code

session_history

set_billing_details

set_file_password

set_file_tags

set_user_email

set_user_password

similar_files

suggest

tie_files

tied_files

tied_files_link

toggle_https_download

toggle_newsletters

unsubscribe_newsletters

upload

upload_progress

upload_url

uploads

user_data

user_vouchers

validate_credentials

verify_file_password

voucher_campaign

voucher_payment

zip_folder

zip_tied_files

accept_terms()

Accept the current version of the terms and conditions.

@return Currently accepted version of the terms and conditions.

Request:

POST /api/accept_terms/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <terms_version>Currently accepted version of the terms and conditions.</terms_version>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ACCEPT_TERMS_FATAL_1</code>
  <message>Access denied.</message>
</response>

activate(string code)

Activate the given user account.

@param string code The activation code sent to the user by an email message.
 
@return The user authentication/session token (WST).

Request:

POST /api/activate/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

code={The activation code sent to the user by an email message.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <token>The user authentication/session token (WST).</token>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ACTIVATE_FATAL_1</code>
  <message>Invalid code.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ACTIVATE_FATAL_2</code>
  <message>Session cannot be created.</message>
</response>

add_file_comment(string file_ident, string body)

Add a new comment to the given file.

@param string file_ident The file identifier.
@param string body The body of the comment.

Request:

POST /api/add_file_comment/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

file_ident={The file identifier.}&body={The body of the comment.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_COMMENT_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_COMMENT_FATAL_2</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_COMMENT_FATAL_3</code>
  <message>Comment cannot be saved.</message>
</response>

add_file_comment_vote(string file_comment_ident, int type)

Add a vote to the given file comment. In order to vote a user has to be authenticated. A single user can vote only once for a single comment.

@param string file_comment_ident The file comment identifier.
@param int type The type of the vote (0 -> negative, 1 -> positive).

Request:

POST /api/add_file_comment_vote/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

file_comment_ident={The file comment identifier.}&type={The type of the vote (0 -> negative, 1 -> positive).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_COMMENT_VOTE_FATAL_1</code>
  <message>You have to be authenticated in order to vote.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_COMMENT_VOTE_FATAL_2</code>
  <message>File comment not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_COMMENT_VOTE_FATAL_3</code>
  <message>You have already voted.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_COMMENT_VOTE_FATAL_4</code>
  <message>Vote cannot be saved.</message>
</response>

add_file_vote(string file_ident, int type)

Add a vote to the given file.

@param string file_ident The file identifier.
@param int type The type of the vote (0 -> negative, 1 -> positive).

Request:

POST /api/add_file_vote/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

file_ident={The file identifier.}&type={The type of the vote (0 -> negative, 1 -> positive).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_VOTE_FATAL_1</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_VOTE_FATAL_2</code>
  <message>You have already voted.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_FILE_VOTE_FATAL_3</code>
  <message>Vote cannot be saved.</message>
</response>

add_user_message(string subject, string message, string email, string name, string uri)

Add a new feedback message.

@param string subject The subject of the feedback message.
@param string message The contents of the feedback message.
@param string email [optional] The user's email address.
@param string name [optional] The user's name.
@param string uri [optional] The URI from which the feedback was sent.

Request:

POST /api/add_user_message/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

subject={The subject of the feedback message.}&message={The contents of the feedback message.}&email={[optional] The user's email address.}&name={[optional] The user's name.}&uri={[optional] The URI from which the feedback was sent.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_USER_FEEDBACK_1</code>
  <message>User feedback cannot be added.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_USER_FEEDBACK_2</code>
  <message>Missing email address.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ADD_USER_FEEDBACK_3</code>
  <message>Missing message body.</message>
</response>

billing_country()

Get available billing country list.

@return The list of a billing country.

Request:

POST /api/billing_country/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <country>
    <name>The country name.</name>
    <tin_regexp>The country id.</tin_regexp>
    <id>The country id.</id>
  </country>
</response>

billing_details()

Get the current user billing's details.

@return The current user billing's details.

Request:

POST /api/billing_details/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <billing_detail>
    <company_name>The billing company name</company_name>
    <email>The billing email</email>
    <crn>The billing company identification number</crn>
    <vat_number>The billing vat identification number</vat_number>
    <address1>The billing address1</address1>
    <address2>The billing address2</address2>
    <zip>The billing zipcode</zip>
    <city>The billing city</city>
    <region>The billing state/region</region>
    <country>The billing country</country>
    <specific_symbol>The billing specific symbol</specific_symbol>
    <created>The billing details created</created>
  </billing_detail>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>BILLING_DETAILS_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>BILLING_DETAILS_FATAL_2</code>
  <message>Not found.</message>
</response>

billing_details_from_ares(int ic)

Get the billing's details from ARES.

@param int ic identification number
 
@return The billing's details from ARES.

Request:

POST /api/billing_details_from_ares/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ic={identification number}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <ares_detail>
    <name>The billing name</name>
    <in>The billing identification number</in>
    <tin>The billing tax identification number</tin>
    <addr_street>The billing street name</addr_street>
    <addr_street_nr>The billing street number</addr_street_nr>
    <addr_house_nr>The billing house number</addr_house_nr>
    <addr_zip>The billing zipcode</addr_zip>
    <addr_city>The billing city</addr_city>
    <addr_country>The billing country</addr_country>
  </ares_detail>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>BILLING_DETAILS_FROM_ARES_1</code>
  <message>Access denied.</message>
</response>

billing_details_from_vies(int|string vat, string country)

Get the billing's details from VIES.

@param int|string vat identification number
@param string country (optional) country code ( [A-Z]{2} )
 
@return The billing's details from VIES.

Request:

POST /api/billing_details_from_vies/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

vat={identification number}&country={(optional) country code ( [A-Z]{2} )}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <vies_detail>
    <name>The company name</name>
    <tin>The billing vat identification number</tin>
    <addr1>The company address</addr1>
    <addr_city>The company city</addr_city>
    <addr_zip>The company zipcode</addr_zip>
    <addr_country>The company country</addr_country>
    <valid>is valid vat number</valid>
  </vies_detail>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>BILLING_DETAILS_FROM_VIES_1</code>
  <message>Access denied.</message>
</response>

billing_payments(int offset, int limit)

Get the billing's list of payments.

@param int offset [optional] The list offset.
@param int limit [optional] The maximum of listed files.
 
@return The billing's list of payments.

Request:

POST /api/billing_payments/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

offset={[optional] The list offset.}&limit={[optional] The maximum of listed files.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <payment>
    <source>Is voucher or payment</source>
    <payment_id>The ID of the payment</payment_id>
    <user_id>The identification of user</user_id>
    <created>Date and Time of payment created</created>
    <amount>The payment amount</amount>
    <months>The number of pay mounths</months>
    <extra_days>The bonus extra days</extra_days>
    <confirmed_at>Date and Time confirmation of payment</confirmed_at>
    <aborted>Is payment aborted ?</aborted>
    <currency>The currency of payment</currency>
    <file>The url of invoice file</file>
  </payment>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>BILLING_PAYMENTS_FATAL_1</code>
  <message>Access denied.</message>
</response>

cancel_upload(string file_ident)

Cancel given file upload.

@param string file_ident The file identifier.

Request:

POST /api/cancel_upload/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

file_ident={The file identifier.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CANCEL_UPLOAD_FATAL_1</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CANCEL_UPLOAD_FATAL_2</code>
  <message>Invalid or no file identifier.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CANCEL_UPLOAD_FATAL_3</code>
  <message>Upload already finished.</message>
</response>

clear_file_password(string ident)

Clear a file password.

@param string ident The identifier of the file which password should be cleared.

Request:

POST /api/clear_file_password/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file which password should be cleared.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CLEAR_FILE_PASSWORD_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CLEAR_FILE_PASSWORD_FATAL_2</code>
  <message>File not found.</message>
</response>

clear_history(int[] ids)

Clear the download history of the current user.

@param int[] ids [optional] The list of IDs of the records to be deleted.

Request:

POST /api/clear_history/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ids={[optional] The list of IDs of the records to be deleted.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CLEAR_HISTORY_FATAL_1</code>
  <message>History cannot been cleared.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CLEAR_HISTORY_FATAL_2</code>
  <message>Access denied.</message>
</response>

confirm_sms_payment(string code)

Confirm an SMS payment.

@param string code The SMS payment confirmation code.

Request:

POST /api/confirm_sms_payment/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

code={The SMS payment confirmation code.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CONFIRM_SMS_PAYMENT_FATAL_1</code>
  <message>Invalid code.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CONFIRM_SMS_PAYMENT_FATAL_2</code>
  <message>Message not yet delivered.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CONFIRM_SMS_PAYMENT_FATAL_3</code>
  <message>Missing payment.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CONFIRM_SMS_PAYMENT_FATAL_4</code>
  <message>Code already used.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CONFIRM_SMS_PAYMENT_FATAL_5</code>
  <message>Payment cancelled.</message>
</response>

create_folder(string path, int private)

Create a new folder.

@param string path The path to the folder. Parent folders are created automatically if necessary.
@param int private Tells whether the folder should be private (0 -> no, 1 -> yes).
 
@return The identifier of the newly created folder and its sanitized name.

Request:

POST /api/create_folder/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

path={The path to the folder. Parent folders are created automatically if necessary.}&private={Tells whether the folder should be private (0 -> no, 1 -> yes).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <ident>The identifier of the newly created folder.</ident>
  <name>Sanitized name of the newly created folder.</name>
  <path>The path to the newly created folder.</path>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CREATE_FOLDER_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>CREATE_FOLDER_FATAL_4</code>
  <message>Folder cannot be created.</message>
</response>

dequeue_file(string ident)

Remove the given file from the download queue.

@param string ident The identifier of the file.

Request:

POST /api/dequeue_file/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>DEQUEUE_FILE_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>DEQUEUE_FILE_FATAL_2</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>DEQUEUE_FILE_FATAL_3</code>
  <message>File cannot be DEQUEUEd.</message>
</response>

file_comments(string ident, string password)

Get the list of user comments for the given file.

@param string ident The identifier of the file.
@param string password [optional] The file password digest SHA1(MD5_CRYPT(password)).
 
@return The list of user comments for the given file.

Request:

POST /api/file_comments/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}&password={[optional] The file password digest SHA1(MD5_CRYPT(password)).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <comment>
    <ident>The identifier of the comment.</ident>
    <created>The date and time when the comment was created.</created>
    <body>The body of the comment.</body>
    <username>The username of the user who sent the comment.</username>
    <positive_votes>The number of positive votes.</positive_votes>
    <negative_votes>The number of negative votes.</negative_votes>
  </comment>
</response>

file_exists(string ident)

Tell whether or not the given file exists.

@param string ident The identifier of the file.
 
@return 1 if the given file exists, 0 otherwise.

Request:

POST /api/file_exists/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <exists>1 if the given file exists, 0 otherwise.</exists>
  <downloadable>1 if the given file is currently downloadable, 0 otherwise.</downloadable>
</response>

file_info(string ident, string password, int maybe_removed)

Get information about the given file.

@param string ident The identifier of the file.
@param string password [optional] File password digest SHA1(MD5_CRYPT(password)).
@param int maybe_removed [optional] Tells whether or not the file may be removed (0 -> No, 1 -> Yes).
 
@return Information about the given file.

Request:

POST /api/file_info/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}&password={[optional] File password digest SHA1(MD5_CRYPT(password)).}&maybe_removed={[optional] Tells whether or not the file may be removed (0 -> No, 1 -> Yes).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <name>The name of the file.</name>
  <description>The description of the file.</description>
  <size>The size of the file in bytes.</size>
  <type>The extension of the file.</type>
  <adult>Tells whether the file is an explicit adult content (0 -> No, 1 -> Yes).</adult>
  <queued>Tells whether the file is queued for later download.</queued>
  <positive_votes>The number of positive votes.</positive_votes>
  <negative_votes>The number of negative votes.</negative_votes>
  <available>Tells whether the file is available for download (0 -> No, 1 -> Yes).</available>
  <password>Tells whether or not the file is password protected (0 -> No, 1 -> Yes).</password>
  <removed>Tells whether or not the file was removed (0 -> No, 1 -> Yes).</removed>
  <removed_at>When the file was removed.</removed_at>
  <removal_reason>Tells why the file was removed.</removal_reason>
  <stripe_count>The number of the file previews.</stripe_count>
  <stripe>The URL of the file preview stripe.</stripe>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FILE_INFO_FATAL_1</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FILE_INFO_FATAL_2</code>
  <message>Incorrect password.</message>
</response>

file_password_salt(string ident, int maybe_removed)

Get password salt of the given file.

@param string ident The identifier of the file.
@param int maybe_removed [optional] Tells whether or not the file may be removed (0 -> No, 1 -> Yes).
 
@return The password salt of the given file.

Request:

POST /api/file_password_salt/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}&maybe_removed={[optional] Tells whether or not the file may be removed (0 -> No, 1 -> Yes).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <salt>The password salt of the given file.</salt>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FILE_PASSWORD_SALT_FATAL_1</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FILE_PASSWORD_SALT_FATAL_2</code>
  <message>No password set.</message>
</response>

file_protected(string ident, int maybe_removed)

Tell whether or not the given file is password protected.

@param string ident The identifier of the file.
@param int maybe_removed [optional] Tells whether or not the file may be removed (0 -> No, 1 -> Yes).
 
@return 1 if the given file is password protected, 0 otherwise.

Request:

POST /api/file_protected/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}&maybe_removed={[optional] Tells whether or not the file may be removed (0 -> No, 1 -> Yes).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <protected>1 if the given file is password protected, 0 otherwise.</protected>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FILE_PROTECTED_FATAL_1</code>
  <message>File not found.</message>
</response>

files(string path, string sort_by, string sort_order, int private, string search, int include_removed, int limit, int offset)

Get the list of a user's files and folders.

@param string path The folder path.
@param string sort_by [optional] How the list should be sorted (name, size, downloads, created).
@param string sort_order [optional] How to order items in the list (asc, desc).
@param int private [optional] Tells whether to get a list of private files/folders (0 -> No, 1 -> Yes).
@param string search [optional] A term to be searched within file/folder names.
@param int include_removed [optional] Tells whether or not to include removed items in the list (0 -> No, 1 -> Yes).
@param int limit [optional] The maximum of items loaded.
@param int offset [optional] The loaded items offset.
 
@return The list of a user's files and folders.

Request:

POST /api/files/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

path={The folder path.}&sort_by={[optional] How the list should be sorted (name, size, downloads, created).}&sort_order={[optional] How to order items in the list (asc, desc).}&private={[optional] Tells whether to get a list of private files/folders (0 -> No, 1 -> Yes).}&search={[optional] A term to be searched within file/folder names.}&include_removed={[optional] Tells whether or not to include removed items in the list (0 -> No, 1 -> Yes).}&limit={[optional] The maximum of items loaded.}&offset={[optional] The loaded items offset.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <folder>
    <ident>The folder identifier.</ident>
    <name>The folder name.</name>
    <created>The date and time of creation.</created>
    <removed>Tells whether or not the folder was removed (0 -> No, 1 -> Yes).</removed>
    <removed_at>When the folder was removed.</removed_at>
    <path>Path to this folder.</path>
    <parent>Identifier of this folder's parent. Present only if it isn't root.</parent>
  </folder>
  <file>
    <ident>The file identifier.</ident>
    <name>The file name.</name>
    <size>The file size.</size>
    <downloads>The number of downloads.</downloads>
    <type>The file type.</type>
    <created>The date and time of creation.</created>
    <state>The file state.</state>
    <password>Tells whether or not the file is password protected (0 -> No, 1 -> Yes).</password>
    <removed>Tells whether or not the file was removed (0 -> No, 1 -> Yes).</removed>
    <removed_at>When the file was removed.</removed_at>
    <path>Path to this file.</path>
    <parent>Identifier of this file's parent. Present only if the parent isn't root.</parent>
  </file>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FILES_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FILES_FATAL_2</code>
  <message>No such path.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FILES_FATAL_3</code>
  <message>That is not a folder.</message>
</response>

folder(string ident, int limit, int offset)

Get files from the given folder.

@param string ident The identifier of the folder.
@param int limit [optional] The maximum of items loaded.
@param int offset [optional] The loaded items offset.
 
@return The files from the given folder.

Request:

POST /api/folder/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the folder.}&limit={[optional] The maximum of items loaded.}&offset={[optional] The loaded items offset.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <name>The name of the folder.</name>
  <total>The number of found files.</total>
  <size>The total size of all files in the folder.</size>
  <file>
    <ident>The identifier of the file.</ident>
    <name>The name of the file.</name>
    <type>The type of the file.</type>
    <img>The preview of the file.</img>
    <stripe>The preview stripe.</stripe>
    <stripe_count>The number of previews in the stripe.</stripe_count>
    <size>The size of the file.</size>
    <password>Tells whether or not the file is password-protected (0 -> No, 1 -> Yes).</password>
  </file>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FOLDER_FATAL_1</code>
  <message>Folder not found.</message>
</response>

help()

Get the list of all documented API functions.

@return The list of all documented API functions.

Request:

POST /api/help/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <function>
    <name>The name of the function.</name>
    <args>The list of arguments.</args>
    <desc>The description of the function.</desc>
    <args_details>
      <arg>
        <name>Name of this argument.</name>
        <type>Type of this argument.</type>
        <desc>Description of this argument.</desc>
      </arg>
    </args_details>
    <return>Description of the return value.</return>
    <response>Contains individual response properties and their descriptions.</response>
    <error>
      <status>Error status.</status>
      <code>The unique code of this error.</code>
      <message>Description of this error.</message>
    </error>
  </function>
</response>

history(int offset, int limit)

Get download history of a user.

@param int offset The list offset.
@param int limit The maximum of listed files.
 
@return Download history of a user.

Request:

POST /api/history/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

offset={The list offset.}&limit={The maximum of listed files.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <total>The number of all downloads in the history.</total>
  <file>
    <download_id>The download ID.</download_id>
    <ident>The downloaded file identifier.</ident>
    <name>The downloaded file name.</name>
    <size>The downloaded file size.</size>
    <started_at>The time when the download started.</started_at>
    <ended_at>The time when the download ended.</ended_at>
    <ip_address>IP address from which this download originated.</ip_address>
    <password>Tells whether or not the file is password-protected (0 -> No, 1 -> Yes).</password>
  </file>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>HISTORY_FATAL_1</code>
  <message>Access denied.</message>
</response>

login(string username_or_email, string password, int keep_logged_in)

Authenticate a user.

@param string username_or_email The username or email address of the user.
@param string password The user's password digest SHA1(MD5_CRYPT(password)).
@param int keep_logged_in Tells whether to keep the user authenticated for a longer period of time (0 -> No, 1 -> Yes).
 
@return A session security token (WST).

Request:

POST /api/login/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

username_or_email={The username or email address of the user.}&password={The user's password digest SHA1(MD5_CRYPT(password)).}&keep_logged_in={Tells whether to keep the user authenticated for a longer period of time (0 -> No, 1 -> Yes).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <token>A session security token (WST).</token>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>LOGIN_FATAL_2</code>
  <message>Access to the beta version is restricted for selected users only.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>LOGIN_FATAL_3</code>
  <message>The user account is disabled or banned.</message>
</response>

logout()

Log out the currently logged user.

Request:

POST /api/logout/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

logout_all_devices()

Log out the currently logged user on all the devices.

Request:

POST /api/logout_all_devices/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>LOGOUT_ALL_DEVICES_1</code>
  <message>Access denied.</message>
</response>

logout_other_devices()

Log out the currently logged user on all other devices.

Request:

POST /api/logout_other_devices/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>LOGOUT_OTHER_DEVICES_1</code>
  <message>Access denied.</message>
</response>

move_file(string src, string dest, int private, int src_private, int dest_private)

Move the given file or folder to another destination. The destination file or folder will be overwritten.

@param string src The source path of the file or folder.
@param string dest The path of the destination folder to which the file should be moved (it does not need to exist).
@param int private [optional] Tells whether or not both the source and the destination are private (0 -> No, 1 -> Yes).
@param int src_private [optional] Tells whether or not the source path is private (0 -> No, 1 -> Yes).
@param int dest_private [optional] Tells whether or not the destination folder is private (0 -> No, 1 -> Yes).

Request:

POST /api/move_file/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

src={The source path of the file or folder.}&dest={The path of the destination folder to which the file should be moved (it does not need to exist).}&private={[optional] Tells whether or not both the source and the destination are private (0 -> No, 1 -> Yes).}&src_private={[optional] Tells whether or not the source path is private (0 -> No, 1 -> Yes).}&dest_private={[optional] Tells whether or not the destination folder is private (0 -> No, 1 -> Yes).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>MOVE_FILE_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>MOVE_FILE_FATAL_3</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>MOVE_FILE_FATAL_4</code>
  <message>Not enough free space in the destination folder.</message>
</response>

news(integer last_id, string lang)

Get the news.

@param integer last_id The ID of the last received news.
@param string lang [optional] News language (CZ, SK, PL or EN).
 
@return The news.

Request:

POST /api/news/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

last_id={The ID of the last received news.}&lang={[optional] News language (CZ, SK, PL or EN).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <news>
    <id>The news ID.</id>
    <created>The date of creation.</created>
    <title>The title of the news.</title>
    <body>The body of the news.</body>
    <link>The link.</link>
  </news>
</response>

payment(string method, int months, string country)

Initiate a new payment.

@param string method Payment method (card, transfer, points).
@param int months The number of months to pay for.
@param string country [optional] Country code (cz -> default or sk), currently relevant only for transfer method.
 
@return A URL to which the user should be redirected to.

Request:

POST /api/payment/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

method={Payment method (card, transfer, points).}&months={The number of months to pay for.}&country={[optional] Country code (cz -> default or sk), currently relevant only for transfer method.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <url>A URL to which the user should be redirected to.</url>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>PAYMENT_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>PAYMENT_FATAL_2</code>
  <message>No payment method selected.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>PAYMENT_FATAL_3</code>
  <message>Unknown payment method.</message>
</response>

queue(int offset, int limit)

Get a user's download queue.

@param int offset The list offset.
@param int limit The maximum of listed files.
 
@return A user's download queue.

Request:

POST /api/queue/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

offset={The list offset.}&limit={The maximum of listed files.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <total>The number of all downloads in the queue.</total>
  <file>
    <ident>The identifier of the file.</ident>
    <name>The name of the file.</name>
    <size>The size of the file.</size>
    <img>The preview of the file.</img>
    <stripe>The preview stripe.</stripe>
    <stripe_count>The number of previews in the stripe.</stripe_count>
    <downloaded>Tells whether or not this file was downloaded by the user (0 -> No, 1 -> Yes).</downloaded>
    <password>Tells whether or not the file is password-protected (0 -> No, 1 -> Yes).</password>
  </file>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>QUEUE_FATAL_1</code>
  <message>Access denied.</message>
</response>

queue_file(string ident)

Add the given file to the download queue.

@param string ident The identifier of the file.

Request:

POST /api/queue_file/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>QUEUE_FILE_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>QUEUE_FILE_FATAL_2</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>QUEUE_FILE_FATAL_3</code>
  <message>File cannot be queued.</message>
</response>

register(string username, string email, string password, string affil_id, string recommend)

Create a new user account.

@param string username New user's (nick)name.
@param string email New user's email address.
@param string password New user's password or its hash (MD5Crypt).
@param string affil_id [optional] Affiliate ID.
@param string recommend [optional] Identifier of the user who recommended WS.
 
@return The user authentication/session token (WST).

Request:

POST /api/register/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

username={New user's (nick)name.}&email={New user's email address.}&password={New user's password or its hash (MD5Crypt).}&affil_id={[optional] Affiliate ID.}&recommend={[optional] Identifier of the user who recommended WS.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <token>The user authentication/session token (WST).</token>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>ERROR</status>
  <code>REGISTER_ERROR_1</code>
  <message>User has been registered but session cannot be created.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>REGISTER_FATAL_1</code>
  <message>Invalid credentials.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>REGISTER_FATAL_2</code>
  <message>User already exists.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>REGISTER_FATAL_3</code>
  <message>User cannot be registered.</message>
</response>

remote_upload(string url, string uri)

Starts a new remote upload.

@param string url The remote file URL.
@param string uri [optional] Alias for the file URL (use either one but not both).
 
@return Information about the remote file.

Request:

POST /api/remote_upload/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

url={The remote file URL.}&uri={[optional] Alias for the file URL (use either one but not both).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <file_name>The name of the remote file.</file_name>
  <file_size>The size of the remote file.</file_size>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>REMOTE_UPLOAD_FATAL_3</code>
  <message>Remote uploads are temporarily unavailable.</message>
</response>

remove_file(string ident)

Remove the given file or folder.

@param string ident The identifier of the file or folder.

Request:

POST /api/remove_file/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file or folder.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>REMOVE_FILE_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>REMOVE_FILE_FATAL_2</code>
  <message>File cannot be removed.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>REMOVE_FILE_FATAL_3</code>
  <message>File not found.</message>
</response>

rename_file(string ident, string name)

Rename the given file or folder.

@param string ident The identifier of the file or folder.
@param string name The new name of the file or folder.
 
@return The new name of the file or folder.

Request:

POST /api/rename_file/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file or folder.}&name={The new name of the file or folder.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <new_name>The new (possibly sanitized) name of the file or folder.</new_name>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>RENAME_FILE_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>RENAME_FILE_FATAL_3</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>RENAME_FILE_FATAL_4</code>
  <message>File cannot be renamed.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>RENAME_FILE_FATAL_6</code>
  <message>Blacklisted file name and/or size.</message>
</response>

reset_password(string email_or_username, string lang)

Reset a user password.

@param string email_or_username The email address or username of the user.
@param string lang [optional] Language.

Request:

POST /api/reset_password/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

email_or_username={The email address or username of the user.}&lang={[optional] Language.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>RESET_PASSWORD_FATAL_1</code>
  <message>User not found.</message>
</response>

running_downloads()

Get the list of downloads that are currently running via this user account.

@return That list of downloads that are currently running via this user account.

Request:

POST /api/running_downloads/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <download>
    <type>Type of this download.</type>
    <client>
      <ip_address>IP address of the client device.</ip_address>
      <browser>Name and version of the client browser.</browser>
      <platform>Name of the operating system on which the client browser is running.</platform>
    </client>
    <file>
      <ident>Identifier of the file that is being downloaded.</ident>
      <name>Name of the file that is being downloaded.</name>
      <size>Size (in bytes) of the file that is being downloaded.</size>
      <password>Tells whether or not the file is password protected (0 -> No, 1 -> Yes).</password>
    </file>
  </download>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>RUNNING_DOWNLOADS_FATAL_1</code>
  <message>Access denied.</message>
</response>

salt(string username_or_email)

Get the given user's password salt.

@param string username_or_email The username or email address of the user.
 
@return The given user's password salt.

Request:

POST /api/salt/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

username_or_email={The username or email address of the user.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <salt>The given user's password salt.</salt>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SALT_FATAL_1</code>
  <message>User not found.</message>
</response>

send_activation_code()

Send e-mail message with activation code to the user's e-mail address.

Request:

POST /api/send_activation_code/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SEND_ACTIVATION_CODE_1</code>
  <message>Access denied.</message>
</response>

session_history()

Get the current user's session history.

@return The current user's session history.

Request:

POST /api/session_history/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <record>
    <created>When the session was created.</created>
    <ip_address>The IP address from which the session was created.</ip_address>
    <browser>The browser from which the session was created.</browser>
    <platform>Name of the operating system on which the browser is running.</platform>
    <country_code>The code of the country from which the session was created.</country_code>
    <country_name>The name of the country from which the session was created.</country_name>
  </record>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SESSION_HISTORY_FATAL_1</code>
  <message>Access denied.</message>
</response>

set_billing_details(string company_name, string address1, string address2, string zip, string city, string region, string country, number crn, number vat_number)

Set the billing's details.

@param string company_name The billing name (compamy name).
@param string address1 The billing street name.
@param string address2 The billing additional address.
@param string zip The billing zipcode.
@param string city The billing city.
@param string region The billing state/region.
@param string country The billing country.
@param number crn [optional] The billing identification number.
@param number vat_number [optional] The billing tax identification number.

Request:

POST /api/set_billing_details/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

company_name={The billing name (compamy name).}&address1={The billing street name.}&address2={The billing additional address.}&zip={The billing zipcode.}&city={The billing city.}&region={The billing state/region.}&country={The billing country.}&crn={[optional] The billing identification number.}&vat_number={[optional] The billing tax identification number.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_BILLING_DETAILS_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_BILLING_DETAILS_FATAL_2</code>
  <message>Failed to save billing details.</message>
</response>

set_file_password(string ident, string password)

Set a file password.

@param string ident The identifier of the file.
@param string password The file password digest (MD5_CRYPT(password)).

Request:

POST /api/set_file_password/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}&password={The file password digest (MD5_CRYPT(password)).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_FILE_PASSWORD_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_FILE_PASSWORD_FATAL_2</code>
  <message>File not found.</message>
</response>

set_file_tags(string ident, map<string,string> tags)

Set the tags of the given file or folder.

@param string ident The identifier of the file or folder.
@param map<string,string> tags Collection of tags (private => 0 or 1, adult => 0 or 1, to_be_removed => 0 or 1).

Request:

POST /api/set_file_tags/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file or folder.}&tags={Collection of tags (private => 0 or 1, adult => 0 or 1, to_be_removed => 0 or 1).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_FILE_TAGS_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_FILE_TAGS_2</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_FILE_TAGS_3</code>
  <message>Not enough free space in the destination folder.</message>
</response>

set_user_email(string email)

Set the current user's email address.

@param string email The new email address of the user.

Request:

POST /api/set_user_email/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

email={The new email address of the user.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_USER_EMAIL_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_USER_EMAIL_FATAL_2</code>
  <message>Email is already taken.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_USER_EMAIL_FATAL_3</code>
  <message>User email cannot be set.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_USER_EMAIL_FATAL_4</code>
  <message>Invalid email address format.</message>
</response>

set_user_password(string old_password, string new_password)

Set the current user's password.

@param string old_password The old password digest (MD5CRYPT(password)) of the user.
@param string new_password The new password digest (MD5CRYPT(password)) of the user.

Request:

POST /api/set_user_password/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

old_password={The old password digest (MD5CRYPT(password)) of the user.}&new_password={The new password digest (MD5CRYPT(password)) of the user.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_USER_PASSWORD_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_USER_PASSWORD_FATAL_2</code>
  <message>Incorrect password.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>SET_USER_PASSWORD_FATAL_3</code>
  <message>User password cannot be set.</message>
</response>

similar_files(string what, string sort, int limit, int offset, string category)

Search similar files.

@param string what The text to be searched within file names.
@param string sort [optional] How the search results should be sorted (recent, rating, largest, smallest).
@param int limit [optional] The maximum of the number of found files.
@param int offset [optional] The search results offset.
@param string category [optional] The category of searched files (video, images, audio, docs, archives).
 
@return The list of found files.

Request:

POST /api/similar_files/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

what={The text to be searched within file names.}&sort={[optional] How the search results should be sorted (recent, rating, largest, smallest).}&limit={[optional] The maximum of the number of found files.}&offset={[optional] The search results offset.}&category={[optional] The category of searched files (video, images, audio, docs, archives).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <subtitles>
    <file>
      <ident>The identifier of the file.</ident>
      <name>The name of the file.</name>
      <type>The type of the file.</type>
      <img>The preview of the file.</img>
      <stripe>The preview stripe.</stripe>
      <stripe_count>The number of previews in the stripe.</stripe_count>
      <size>The size of the file.</size>
      <queued>Tells whether the file was queued for later download.</queued>
    </file>
  </subtitles>
  <next_episode>
    <file>
      <ident>The identifier of the file.</ident>
      <name>The name of the file.</name>
      <type>The type of the file.</type>
      <img>The preview of the file.</img>
      <stripe>The preview stripe.</stripe>
      <stripe_count>The number of previews in the stripe.</stripe_count>
      <size>The size of the file.</size>
      <queued>Tells whether the file was queued for later download.</queued>
    </file>
  </next_episode>
  <similar>
    <file>
      <ident>The identifier of the file.</ident>
      <name>The name of the file.</name>
      <type>The type of the file.</type>
      <img>The preview of the file.</img>
      <stripe>The preview stripe.</stripe>
      <stripe_count>The number of previews in the stripe.</stripe_count>
      <size>The size of the file.</size>
      <queued>Tells whether the file was queued for later download.</queued>
      <password>Tells whether or not the file is password-protected (0 -> No, 1 -> Yes).</password>
    </file>
  </similar>
</response>

suggest(string what, int limit)

Suggest file names to search.

@param string what The phrase to be searched for.
@param int limit [optional] The maximum of the number of suggestions.
 
@return The list of suggestions.

Request:

POST /api/suggest/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

what={The phrase to be searched for.}&limit={[optional] The maximum of the number of suggestions.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <suggestion>
    <value>A suggestion text value.</value>
  </suggestion>
</response>

tie_files(string[] idents)

Create a new file bundle.

@param string[] idents The list of identifiers of the files to be bundled.
 
@return The identifier of the newly created file bundle.

Request:

POST /api/tie_files/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

idents={The list of identifiers of the files to be bundled.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <ident>The identifier of the newly created file bundle.</ident>
</response>

tied_files(string ident)

Get files from the given bundle.

@param string ident The identifier of the bundle.
 
@return The files from the given bundle.

Request:

POST /api/tied_files/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the bundle.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <total>The number of found files.</total>
  <size>The total size of all files in the bundle.</size>
  <file>
    <ident>The identifier of the file.</ident>
    <name>The name of the file.</name>
    <type>The type of the file.</type>
    <img>The preview of the file.</img>
    <stripe>The preview stripe.</stripe>
    <stripe_count>The number of previews in the stripe.</stripe_count>
    <size>The size of the file.</size>
    <password>Tells whether or not the file is password-protected (0 -> No, 1 -> Yes).</password>
  </file>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>FOLDER_FATAL_1</code>
  <message>Folder not found.</message>
</response>

toggle_https_download()

Enable/disable HTTPS for file downloads.

@return 1 if HTTPS was enabled, 0 otherwise.

Request:

POST /api/toggle_https_download/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <enabled>1 if HTTPS was enabled, 0 otherwise.</enabled>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>TOGGLE_HTTPS_DOWNLOAD_FATAL_1</code>
  <message>Access denied.</message>
</response>

toggle_newsletters()

Enable/disable sending of newsletters.

@return 1 if the sending was enabled, 0 otherwise.

Request:

POST /api/toggle_newsletters/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <enabled>1 if the sending was enabled, 0 otherwise.</enabled>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>TOGGLE_NEWSLETTERS_FATAL_1</code>
  <message>Access denied.</message>
</response>

unsubscribe_newsletters()

Unsubscribe user from newsletters.

Request:

POST /api/unsubscribe_newsletters/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>UNSUBSCRIBE_NEWSLETTER_FATAL_1</code>
  <message>Access denied.</message>
</response>

upload(string ident, int total, int offset, string description)

Process the uploaded file.

@param string ident [optional] The identifier of the uploaded file.
@param int total [optional] The total size of the uploaded file.
@param int offset [optional] The position to which seek the file pointer.
@param string description [optional] The description of the uploaded file.
 
@return The result of the operation.

Request:

POST /api/upload/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={[optional] The identifier of the uploaded file.}&total={[optional] The total size of the uploaded file.}&offset={[optional] The position to which seek the file pointer.}&description={[optional] The description of the uploaded file.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <ident>The identifier of the uploaded file.</ident>
</response>

upload_progress(string file_ident)

Get an upload progress.

@param string file_ident The file identifier.
 
@return The upload progress.

Request:

POST /api/upload_progress/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

file_ident={The file identifier.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <uploaded_bytes>Number of uploaded bytes so far.</uploaded_bytes>
  <done>Tells whether or not the file upload is done (0 -> No, 1 -> Yes).</done>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>UPLOAD_PROGRESS_FATAL_1</code>
  <message>File not found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>UPLOAD_PROGRESS_FATAL_2</code>
  <message>Invalid or no file identifier.</message>
</response>

upload_url()

Get a URL which files should be uploaded to.

@return A URL which files should be uploaded to.

Request:

POST /api/upload_url/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <url>A URL which files should be uploaded to.</url>
</response>

uploads(int limit, int offset)

Get list of all the files uploaded by a user.

@param int limit [optional] The maximum items loaded.
@param int offset [optional] The loaded items offset.

Request:

POST /api/uploads/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

limit={[optional] The maximum items loaded.}&offset={[optional] The loaded items offset.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <file>
    <ident>The file identifier.</ident>
    <name>The file name.</name>
    <size>The file size.</size>
    <type>The file type.</type>
    <uploaded>The date and time of upload.</uploaded>
    <state>The file state.</state>
    <downloads>The number of downloads.</downloads>
    <password>Tells whether or not the file is password protected (0 -> No, 1 -> Yes).</password>
    <path>The current path to the file.</path>
  </file>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>UPLOADS_FATAL_1</code>
  <message>Access denied.</message>
</response>

user_data()

Get the current user's data.

@return The current user's data.

Request:

POST /api/user_data/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <id>The ID of the user.</id>
  <ident>The identifier of the user.</ident>
  <username>The username of the user.</username>
  <email>The email address of the user.</email>
  <points>The number of points collected by the user.</points>
  <files>The number of files the user currently has.</files>
  <bytes>The total size in bytes of all the user's files.</bytes>
  <score_files>The number of the user's files which have been downloaded by other users.</score_files>
  <score_bytes>The total size of all the user's files which have been downloaded by other users.</score_bytes>
  <private_files>The number of private files the user currently has.</private_files>
  <private_bytes>The total size in bytes of all the user's private files.</private_bytes>
  <private_space>The size in bytes of the user's private space.</private_space>
  <tester>Tells whether the user is a tester (0 -> No, 1 -> Yes).</tester>
  <vip>Tells whether the user is a VIP (0 -> No, 1 -> Yes).</vip>
  <vip_days>The number of days for which the user remain a VIP.</vip_days>
  <vip_hours>The number of hours for which the user remain a VIP.</vip_hours>
  <vip_minutes>The number of minutes for which the user remain a VIP.</vip_minutes>
  <vip_until>The date and time until which the user remain a VIP.</vip_until>
  <terms_version>Currently accepted version of the terms and conditions.</terms_version>
  <email_verified>Tells whether or not the user's email address is verified (0 -> No, 1 -> Yes).</email_verified>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>GET_USER_DATA_1</code>
  <message>Access denied.</message>
</response>

user_vouchers()

Get the list of a user's vouchers.

@return The list of a user's vouchers.

Request:

POST /api/user_vouchers/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <unused_voucher>
    <code>The voucher code.</code>
    <months>The number of months of being a VIP.</months>
    <days>The number of days of being a VIP.</days>
    <price>The price paid for the voucher.</price>
    <currency>Currency code.</currency>
    <paid>When the voucher was paid for.</paid>
    <url>[optional] The URL of the voucher PDF file.</url>
  </unused_voucher>
  <used_voucher>
    <code>The voucher code.</code>
    <months>The number of months of being a VIP.</months>
    <days>The number of days of being a VIP.</days>
    <price>The price paid for the voucher.</price>
    <currency>Currency code.</currency>
    <used>When the voucher was used.</used>
    <seller>The name of the voucher seller.</seller>
    <url>[optional] The URL of the voucher PDF file.</url>
  </used_voucher>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>USER_VOUCHERS_FATAL_1</code>
  <message>Access denied.</message>
</response>

validate_credentials(string username, string email, string password, string password_again)

Validate the given user credentials.

@param string username A username.
@param string email An email address.
@param string password Password hashed by md5crypt algorithm (if you absolutely must you can send plain text).
@param string password_again Password hashed by md5crypt algorithm (if you absolutely must you can send plain text).
 
@return The validation results.

Request:

POST /api/validate_credentials/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

username={A username.}&email={An email address.}&password={Password hashed by md5crypt algorithm (if you absolutely must you can send plain text).}&password_again={Password hashed by md5crypt algorithm (if you absolutely must you can send plain text).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <email_exists>Tells whether the given email address already exists or not (0 -> No, 1 -> Yes).</email_exists>
  <username>Tells whether the given username is valid (0 -> No, 1 -> Yes).</username>
  <email>Tells whether the given email address is valid (0 -> No, 1 -> Yes).</email>
  <password>Tells whether the given password is valid (0 -> No, 1 -> Yes).</password>
  <password_again>Tells whether the given passwords match (0 -> No, 1 -> Yes).</password_again>
</response>

verify_file_password(string ident, string password)

Verify a file password.

@param string ident The identifier of the file.
@param string password The file password digest (SHA1(MD5_CRYPT(password))).
 
@return 1 if the given file password digest (SHA1(MD5_CRYPT(password))) is correct, 0 otherwise.

Request:

POST /api/verify_file_password/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the file.}&password={The file password digest (SHA1(MD5_CRYPT(password))).}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <correct>1 if the given file password digest (SHA1(MD5_CRYPT(password))) is correct, 0 otherwise.</correct>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VERIFY_FILE_PASSWORD_FATAL_1</code>
  <message>File not found.</message>
</response>

voucher_campaign()

Get currently running voucher campaign.

Request:

POST /api/voucher_campaign/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

voucher_payment(string code)

Apply the given voucher code.

@param string code The code of the voucher to be applied.

Request:

POST /api/voucher_payment/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

code={The code of the voucher to be applied.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_1</code>
  <message>Access denied.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_10</code>
  <message>The given voucher was cancelled at Slevomat.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_11</code>
  <message>The given voucher expired at Slevomat.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_12</code>
  <message>The voucher campaign has not started yet at Slevomat.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_2</code>
  <message>No such voucher exists.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_3</code>
  <message>The given voucher was already used.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_4</code>
  <message>Voucher limit for this campaign exceeded.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_5</code>
  <message>Voucher was cancelled.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_6</code>
  <message>Unknown Slevomat error.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_7</code>
  <message>No such voucher found at Slevomat.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_8</code>
  <message>The given voucher has not been paid at Slevomat.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>VOUCHER_PAYMENT_FATAL_9</code>
  <message>The given voucher was refunded at Slevomat.</message>
</response>

zip_folder(string ident)

Creates a new request to create a ZIP archive containing files from the given folder.

@param string ident The identifier of that folder.
 
@return A new request to create a ZIP archive containing files from the given folder.

Request:

POST /api/zip_folder/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of that folder.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <method>The request HTTP method.</method>
  <url>The request target URL.</url>
  <body>The request body.</body>
  <skipped>
    <file>
      <path>The path of this file in the archive.</path>
      <size>The size of this file in bytes.</size>
      <reason>The reason why this file was skipped.</reason>
    </file>
  </skipped>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ZIP_FOLDER_FATAL_1</code>
  <message>No such folder found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ZIP_FOLDER_FATAL_2</code>
  <message>Too many running downloads on too many devices.</message>
</response>

zip_tied_files(string ident)

Creates a new request to create a ZIP archive containing the given tied files.

@param string ident The identifier of the bundle.
 
@return A new request to create a ZIP archive containing the given tied files.

Request:

POST /api/zip_tied_files/ HTTP 1.1
Host: webshare.cz
Accept: text/xml; charset=UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8

ident={The identifier of the bundle.}

Response:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>OK</status>
  <method>The request HTTP method.</method>
  <url>The request target URL.</url>
  <body>The request body.</body>
  <skipped>
    <file>
      <path>The path of this file in the archive.</path>
      <size>The size of this file in bytes.</size>
      <reason>The reason why this file was skipped.</reason>
    </file>
  </skipped>
</response>

Errors:

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ZIP_TIED_FILES_FATAL_1</code>
  <message>No such tie found.</message>
</response>

HTTP/1.0 200 OK
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0"?>
<response>
  <status>FATAL</status>
  <code>ZIP_TIED_FILES_FATAL_2</code>
  <message>Too many running downloads on too many devices.</message>
</response>