sendspace API (1.2)

> Upload New File

Developer Guide

The sendspace Application Programming Interface (API) allows you to embed sendspace services in your applications, programs, or scripts, regardless of platform and programming language.
All communication with the sendspace API (1.2) assumes a UTF-8 encoding.

Methods

sendspace API (1.2) currently supports the following methods:
Authentication

Method: auth.register

Description

Creates a new user account. An activation/validation email will be sent automatically to the user.

Arguments
Name Mandatory Description
api_key Yes Received from sendspace
full_name Yes a-z/A-Z/space , 3-100 chars
email Yes Valid email address required
password Yes Can be left empty and the API will create a unique password or enter one with 4-20 chars
Returns

ok status

Response

<result method="auth.register" status="ok">
    <status>ok</status>
</result>
                
Possible Errors
Code Name Description
11 API_ERROR_PERMISSION_DENIED Permission denied
27 API_ERROR_REGISTRATION_ERROR * A specific text message will be sent according to the error *

Method: auth.createToken

Description

Obtains a new and random token per session. Required for login.

Arguments
Name Mandatory Description
api_key Yes Received from sendspace
api_version Yes Api revision number, e.g. 1.2
app_version No Application specific, formatting / style is up to you
response_format No Value must be: XML
Returns

A token to be used with the auth.login method

Response

<result method="auth.createToken" status="ok">
    <token>xxxx</token>
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=auth.createtoken&api_key=12DPC5Q11N&api_version=1.0&response_format=xml&app_version=0.1
                    
                
Possible Errors
Code Name Description
5 API_ERROR_BAD_API_VERSION Unknown or unsupported API version
25 API_ERROR_OUTDATED_VERSION The application version you are using is too old. Please upgrade it.

Method: auth.login

Description

Starts a session and returns user API method capabilities -- which features the given user can and cannot use.

Arguments
Name Mandatory Description
token Yes Received on create token
user_name Yes Registered email address
tokened_password Yes lowercase(md5(token+lowercase(md5(password)))) - md5 values should always be lowercase.
Returns

session_key to be sent with all method calls, user information, including the user account's capabilities. Only business users may receive chat_ready in response: 0/absent - instant messaging unavailable, 1 - only one user in the team, 2 – available and one or more team mate can be contacted.

Response

<result method="auth.login" status="ok">
    <session_key>XXXX</session_key>
    <user_name>Full name</user_name>
    <email>XXXX</email>
    <membership_type>pro/max/lite</membership_type>
    <membership_ends>timestamp/0=expired/-1=unlimited</membership_ends>
    <subscribed>0/1</subscribed>
    <capable_upload>0/1</capable_upload>
    <capable_download>0/1</capable_download>
    <capable_folders>0/1</capable_folders>
    <capable_files>0/1</capable_files>
    <chat_ready>0/1/2</chat_ready>
    <bandwidth_left>bytes/-1=unlimited</bandwidth_left>
    <diskspace_left>bytes/-1=unlimited</diskspace_left>
    <diskspace_used>bytes</diskspace_used>
    <points>0</points>   
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=auth.login&token=57md654jwfl6l25idskzh8x3b5zwp46k&[email protected]&tokened_password=2cb501e4j86ef8ad17f6b26b90ee5764
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
8 API_ERROR_AUTHENTICATION_FAILURE Authentication error
11 API_ERROR_PERMISSION_DENIED Permission denied

Method: auth.checksession

Description

Checks if a session is valid or not.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
Returns

Session status (OK/Expired) and up to date account statistics which include the of user's remaining bandwidth & disk space information

Response

<result method="auth.checkSession" status="ok">
    <session>ok/expired</session>
    <bandwidth_left>bytes/-1=unlimited</bandwidth_left>
    <diskspace_left>bytes/-1=unlimited</diskspace_left>
</result>
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
7 API_ERROR_SESSION_NOT_AUTH Session not authenticated

Method: auth.logout

Description

Logs out from a session.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
Returns

OK status

Response

<result method="auth.logout" status="ok">
    <status>ok</status>
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=auth.logout&session_key=zm2bh8t1n0kcjfr97kxbvyy8wch5vtek
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
Upload

Method: upload.getInfo

Description

Obtains the information needed to perform an upload.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
speed_limit No Upload speed limit in kilobytes, 0 for unlimited
Returns

URL to upload the file to, progress_url for real-time progress information, max_file_size for max size current user can upload, upload_identifier & extra_info to be passed with the upload form

Response

<result method="upload.getInfo" status="ok">
    <upload url="" progress_url="" max_file_size="" upload_identifier="" extra_info="" />
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=upload.getinfo&session_key=9i96woykgory1crglmykgycjwa5k2cq2&speed_limit=0
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
11 API_ERROR_PERMISSION_DENIED Permission denied
19 API_ERROR_PRO_EXPIRED Pro user, account expired
20 API_ERROR_PRO_DISKSPACE_LIMIT Pro user, reached disk space limit
upload method

<form method="post" action="[url value received in response]" enctype="multipart/form-data">
    <!-- MUST FIELDS -->
    <input type="hidden" name="MAX_FILE_SIZE" value="[max_file_size value received in response]">
    <input type="hidden" name="UPLOAD_IDENTIFIER" value="[upload_identifier value received in response]">
    <input type="hidden" name="extra_info" value="[extra_info value received in response]">
    <input type="file" name="userfile">

    <!-- OPTIONAL FIELDS --->
    <input type="text" name="description">
    <input type="text" name="password">
    <input type="text" name="folder_id">
    <input type="text" name="recipient_email">  <!-- an email (or emails separated with ,) of recipient/s to receive information about the upload -->
    <input type="text" name="recipient_message">  <!-- a message to include in email to recipient/s -->
    <input type="checkbox" name="notify_uploader" value="1">  <!-- 0/1 - should the uploader be notified? -->
    <input type="hidden" name="redirect_url">  <!-- page to redirect after upload will be attached upload_status=ok/fail&file_id=XXXX -->
</form>
                        
Different file input name
In case an application is used that hard codes the upload input field (such as Adobe Flash), it is possible to send this field name with the value of "userfile". The code will then know to read from that input, instead of "userfile".
When Upload Ends
If redirect_url was given, it will redirect to the URL, also adding two extra URL params to it:
* upload_status: ok/fail
* file_id: file_id (can be used in the API for later)
If no redirect_url is given, a page with the following text will be sent:

upload_status=ok/fail
file_id=XXXX
bandwidth_left=bytes/-1(=unlimited)
diskspace_left=bytes/-1(=unlimited)

Progress Bar
Reading from progress_url will give the an XML output similar to this:

<progress>
    <status>ok/fail/done</status>
    <eta>00:00:00</eta>
    <speed>50</speed> <!-- in kbps -->
    <uploaded_bytes>1000</uploaded_bytes> <!-- in bytes -->
    <total_size>50000</total_size> <!-- in bytes -->
    <elapsed>00:00:00</elapsed>
    <meter>0-100</meter> <!-- percentage of upload done -->
</progress>


Because the xHTTPRequest JavaScript call, for security reasons, is unable to issue requests to hosts other than the host the page originated from, you need to make use of a simple proxy to read the progress information. For example:

<?
header("Content-type: text/xml");
echo file_get_contents($_REQUEST['url']);
?>

Multiple Uploads
Multiple upload is supported by adding userfileN & descriptionN fields to the form where N is a number from 2 to 100.

* Use "userfile" & "description" without the number "1" for the first file.

Example for uploading 3 files:

<input type="file" name="userfile">
<input type="text" name="description">
<input type="file" name="userfile2">
<input type="text" name="description2">
<input type="file" name="userfile3">
<input type="text" name="description3">
Anonymous

Method: anonymous.uploadGetInfo

Description

Obtains the basic information needed to make an anonymous upload. This method does not require authentication or login.

Arguments
Name Mandatory Description
speed_limit No Upload speed limit in kilobytes, 0 for unlimited
api_key Yes Received from sendspace
api_version Yes 1.0
app_version No Application specific, formatting / style is up to you
Returns

URL to upload the file to, progress_url for real-time progress information, max_file_size for max size current user can upload, upload_identifier & extra_info to be passed in the upload form

Response

<result method="anonymous.uploadgetinfo" status="ok">
    <upload url="" progress_url="" max_file_size="" upload_identifier="" extra_info="" />
</result>
                
Possible Errors
Code Name Description
5 API_ERROR_BAD_API_VERSION Unknown or unsupported API version
upload method

<form method="post" action="[url value received in response]" enctype="multipart/form-data">
    <!-- MUST FIELDS -->
    <input type="hidden" name="MAX_FILE_SIZE" value="[max_file_size value received in response]">
    <input type="hidden" name="UPLOAD_IDENTIFIER" value="[upload_identifier value received in response]">
    <input type="hidden" name="extra_info" value="[extra_info value received in response]">
    <input type="file" name="userfile">

    <!-- OPTIONAL FIELDS --->
    <input type="text" name="description">
    <input type="text" name="recipient_email">  <!-- an email (or emails separated with ,) of recipient/s to receive information about the upload -->
    <input type="text" name="recipient_message">  <!-- a message to include in email to recipient/s -->
    <input type="text" name="notify_uploader" value="">  <!-- uploader email -->
    <input type="hidden" name="redirect_url">  <!-- page to redirect after upload will be attached upload_status=ok/fail&file_id=XXXX -->
</form>
                    
When Upload Ends
If redirect_url was given, it will redirect to the URL, also adding two extra URL params to it:
* upload_status: ok/fail
* file_id: file_id (can be used in the API for later)
If no redirect_url is given, an xml page with following format will be sent:

<upload_done>
    <status>ok</status>
    <download_url>http://www.sendspace.com/file/XXXXX</download_url>
    <delete_url>http://www.sendspace.com/delete/XXXXX/YYYY</delete_url>
    <file_id>XXXXX</file_id>
</upload_done>

Progress Bar
Reading from progress_url can give the following XML result:

<progress>
    <status>ok/fail/done</status>
    <eta>00:00:00</eta>
    <speed>50</speed> <!-- in kbps -->
    <uploaded_bytes>1000</uploaded_bytes> <!-- in bytes -->
    <total_size>50000</total_size> <!-- in bytes -->
    <elapsed>00:00:00</elapsed>
    <meter>0-100</meter> <!-- percentage of upload done -->
</progress>


Because Ajax, for security reasons, is unable to issue requests to hosts other than the host the pages originated from, you need to make use a proxy to read the progress information. For example:

<?
header("Content-type: text/xml");
echo file_get_contents($_REQUEST['url']);
?>

Method: anonymous.filesSendMail

Description

Sends the file link (URL) to the recipient(s), by email.

Arguments
Name Mandatory Description
api_key Yes Received from sendspace
api_version Yes 1.0
app_version No Application specific, formatting / style is up to you
file_id Yes file_id or list of files' id's (a1a1a1,s2s2s2,d3d3d3)
sender_email Yes Sender email
emails Yes List of emails to send
message No Additional message to send the recipients
Returns

id of the file if operation was successful

Response

<!-- successful response -->             
<result method="anonymous.filesSendMail" status="ok">
    <status>ok</status>
    <id>$file_id</id>
</result>    
 
<!-- failed response -->
<result method="anonymous.filesSendMail" status="fail">
        <error code="24" text="Email(s) are invalid"/>
        <id>6wnhxi</id>
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=anonymous.filessendmail&sender_email=webmasteratsendspacedotcom&file_id=abcdef&emails=webmasteratsendspacedotcom&message=check+this+file
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
9 API_ERROR_FILE_NOT_FOUND File not found
24 API_ERROR_INVALID_EMAIL Email(s) are invalid
Download

Method: download.getInfo

Description

Returns information required to download a file.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
file_id Yes file_id or full file URL starting with http://
password No
Returns

URL for direct download of the file, and file information (name & size)

Response

<result method="download.getInfo" status="ok">
    <download file_id="" name="" url="" file_size="" />
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=download.getinfo&session_key=9i96woykgory1crglmykgycjwa5k2cq2&file_id=http%3A%2F%2Fsendspace.com%2Ffile%2Fxapz8a
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
9 API_ERROR_FILE_NOT_FOUND File not found
11 API_ERROR_PERMISSION_DENIED Permission denied
12 API_ERROR_DOWNLOAD_TEMP_ERROR Download is temporarily unavailable
19 API_ERROR_PRO_EXPIRED Pro user, account expired
22 API_ERROR_BAD_PASSWORD A wrong or empty password was given
23 API_ERROR_BANDWIDTH_LIMIT Account bandwidth limit reached
26 API_ERROR_INVALID_FILE_URL Not a sendspace download URL (must start with http://www.sendspace.com/ and contain a 6 character link)
Files

Method: files.getInfo

Description

Gets information about a specific file.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
file_id Yes file_id or list of files id's (a1a1a1,s2s2s2,d3d3d3)
Returns

Full file information including size, upload date, download URLs & number of downloads, password property present if protection was set. The property business_shared=1 will be returned if granted access to team, but not_owned=1 if file acessed by unprivileged member, in such case delete_url and password properties will be absent.

Response

<!-- successful response -->
<result method="files.getInfo" status="ok">
    <file id="" name="" description="" password="" folder_id="" download_page_url="" direct_download_url="" delete_url="" upload_time="" file_size="" downloads="" time_limit="" download_limit="" limit_action="" limit_action_to_folder="" business_shared="" not_owned="" />
</result>           

<!-- failed response -->
<result method="files.getinfo" status="fail">
        <error code="9" text="File not found"/>
        <id>u5txwy</id>
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=files.getinfo&session_key=9i96woykgory1crglmykgycjwa5k2cq2&file_id=hklv47
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
9 API_ERROR_FILE_NOT_FOUND File not found

Method: files.moveToFolder

Description

Moves a file or files into a specific folder.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
file_id Yes file_id or list of files' id's (a1a1a1,s2s2s2,d3d3d3)
folder_id Yes A folder_id code or 0 for root folder
Returns

Full file information(s) and comma-separated list of IDs suceeded to move in an "id" tag. One or several error messages, optionally containing specific reason and IDs of those files failed in an "id" property.

Response

<!-- successful response -->
<result method="files.movetoFolder" status="ok">
    <id>abcdef,abcdeg<id>
    <file id="abcdef" ... />
    <file id="abcdeg" ... />
</result>

<!-- failed response -->
<result method="files.movetoFolder" status="fail">
    <error code="..." text="Permission denied" />
</result>  

<!-- mixed response -->					
<result method="files.movetoFolder" status="ok">
    <id>abcdef,abcdeg<id>
    <file id="abcdef" ... />
    <file id="abcdeg" ... />
    <error code="..." text="..." id="abcdeh,abcdek" />
    <error code="..." text="..." id="abcdei,abcdej" />
</result>									      
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=files.movetofolder&session_key=9i96woykgory1crglmykgycjwa5k2cq2&file_id=x5l7qv&folder_id=2l28mq
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
9 API_ERROR_FILE_NOT_FOUND File not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
11 API_ERROR_PERMISSION_DENIED Permission denied

Method: files.setInfo

Description

Updates information about a specific file.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
file_id Yes file_id or list of files id's (a1a1a1,s2s2s2,d3d3d3)
name No Only use if you want to change data. Sending empty will clear existing data.
description No Only use if you want to change data. Sending empty will clear existing data.
password No Only use if you want to change data. Sending empty will clear existing data.
folder_id No A folder_id code or 0 for root folder
business_shared No 1 to set, 0 to unset folder as shared to your business team. Only works for business plan users and top-level folders.
time_limit No Seconds until limit reached
download_limit No Total number of downloads until limit reached
limit_action No Action to perform when reached limit (1=block downloads, 2=delete file, 3=move file to a different folder)
limit_action_to_folder No folder_id if limit_action is 3
Returns

Full and up to date file information if the operation was successful

Response

<result method="files.setInfo" status="ok">
    <file id="" ... />
</result>       
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=files.setinfo&session_key=9i96woykgory1crglmykgycjwa5k2cq2&file_id=hklv47&name=Crazy+frog+-+Popcorn.mp3&folder_id=k6vpyz
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
9 API_ERROR_FILE_NOT_FOUND File not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
11 API_ERROR_PERMISSION_DENIED Permission denied

Method: files.delete

Description

Deletes a single file or more. This action cannot be reversed.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
file_id Yes file_id or list of files' id's (a1a1a1,s2s2s2,d3d3d3)
Returns

Minimal file tag(s) and comma-separated list of IDs suceeded to delete in an "id" tag. One or several error messages, optionally containing specific reason and IDs of those files failed in an "id" property.

Response

<!-- successful response -->
<result method="files.delete" status="ok">
    <id>abcdef,abcdeg</id>
    <file id="abcdef" />
    <file id="abcdeg" />
</result>

<!-- failed response -->
<result method="files.delete" status="fail">
    <error code="..." text="Permission denied"/>
</result>
									
<!-- mixed response -->
<result method="files.delete" status="ok">
    <id>abcdef,abcdeg<id>
    <file id="abcdef" />
    <file id="abcdeg" />
    <error code="..." text="" id="abcdeh,abcdek" />
    <error code="..." text="" id="abcdei,abcdej" />
</result>									
                
Usage Example
requesting deletion of 1 file:
                                           
http://api.sendspace.com/rest/?method=files.delete&session_key=9i96woykgory1crglmykgycjwa5k2cq2&file_id=2u0v02
                    
                
requesting deletion of more than 1 file:
                                           
http://api.sendspace.com/rest/?method=files.delete&session_key=9i96woykgory1crglmykgycjwa5k2cq2&file_id=yqnz48%2Cfbl8my
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
9 API_ERROR_FILE_NOT_FOUND File not found
11 API_ERROR_PERMISSION_DENIED Permission denied

Method: files.sendMail

Description

Sends the file link (URL) to the recipient(s), by email.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
file_id Yes file_id or list of files' id's (a1a1a1,s2s2s2,d3d3d3)
emails Yes List of emails to send
message No Additional message to send the recipients
direct_link No For PRO users to send direct link or not
Returns

id of the file if operation was successful

Response

<!-- successful response -->             
<result method="files.sendMail" status="ok">
    <id>$file_id</id>
</result>    
 
<!-- failed response -->
<result method="files.sendmail" status="fail">
        <error code="24" text="Email(s) are invalid"/>
        <id>6wnhxi</id>
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=files.sendmail&session_key=9i96woykgory1crglmykgycjwa5k2cq2&file_id=u5txwy&emails=webmasteratsendspacedotcom&message=check+this+file
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
9 API_ERROR_FILE_NOT_FOUND File not found
24 API_ERROR_INVALID_EMAIL Email(s) are invalid
Folders

Method: folders.getInfo

Description

Gets information about a specific folder.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
folder_id Yes A folder_id code or 0 for root folder
Returns

Folder information. The folder_password property may be present if protection was set; business_shared=1 if allowed access by team, not_owned=1 for read-only access.

Response

<result method="folders.getInfo" status="ok">
    <folder id="" name="" shared="" public_url="" rss_url="" parent_folder_id="" total_files="" total_size="" total_folders="" folder_password="" not_owned="" business_shared="" />
</result>
                
Usage Example
                                           
    http://api.sendspace.com/rest/?method=folders.getinfo&session_key=9i96woykgory1crglmykgycjwa5k2cq2&folder_id=f97uqo
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
11 API_ERROR_PERMISSION_DENIED Permission denied

Method: folders.create

Description

Creates a new folder.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
name Yes
shared No Value can be 0 for private or 1 for public
parent_folder_id No A folder_id code or 0 for root folder
Returns

New folder information

Response

<result method="folders.create" status="ok">
    <folder id="..." ... />
</result>      
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=folders.create&session_key=9i96woykgory1crglmykgycjwa5k2cq2&name=test&shared=0&parent_folder_id=0
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
11 API_ERROR_PERMISSION_DENIED Permission denied

Method: folders.setInfo

Description

Updates folder information.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
folder_id Yes A folder_id code or 0 for root folder
name No Only use if you want to change data. Sending empty will clear existing data.
shared No Value can be 0 for private or 1 for public. Only use if you want to change data. Sending empty will clear existing data.
parent_folder_id No Only use if you want to change data. Sending empty will clear existing data.
Returns

Current folder information

Response

<result method="folders.setInfo" status="ok">
    <folder id="" name="" shared="" public_url="" rss_url="" parent_folder_id=""/>
</result>
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
11 API_ERROR_PERMISSION_DENIED Permission denied
31 API_ERROR_BAD_TARGET_FOLDER Invalid target folder selected

Method: folders.delete

Description

Deletes a folder including all sub-folders and files inside.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
folder_id Yes folder_id or list of folders' id's (a1a1a1,s2s2s2,d3d3d3)
Returns

Minimal folder tag(s) and comma-separated list of IDs suceeded to delete in an "id" tag. One or several error messages, optionally containing specific reason and IDs of those folders failed in an "id" property.

Response

<!-- successful response -->
<result method="folders.delete" status="ok">
    <id>abcdef,abcdeg</id>
    <folder id="abcdef" />
    <folder id="abcdeg" />
</result>       
									
<!-- failed response -->
<result method="folders.delete" status="fail">
    <error code="..." text="Permission denied"/>
</result>
									
<!-- mixed response -->
<result method="folders.delete" status="ok">
    <id>abcdef,abcdeg<id>
    <folder id="abcdef" />
    <folder id="abcdeg" />
    <error code="..." text="..." id="abcdeh,abcdek" />
    <error code="..." text="..." id="abcdei,abcdej" />
</result>		
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=folders.delete&session_key=9i96woykgory1crglmykgycjwa5k2cq2&folder_id=id1y0r
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
11 API_ERROR_PERMISSION_DENIED Permission denied
14 API_ERROR_FOLDER_NOT_EMPTY Folder is not empty

Method: folders.getContents

Description

Obtains the full contents of a folder, including files and any sub-folders.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
folder_id Yes A folder_id code or 0 for root folder
Returns

Files & folders information list

Response

<result method="folders.getContents" status="ok">
    <folder id="" name="" shared="" public_url="" rss_url="" parent_folder_id=""/>
    ...
    <folder id="" name="" shared="" public_url="" rss_url="" parent_folder_id=""/>
    <file id="" name="" description="" password="" folder_id="" download_page_url="" direct_download_url="" upload_time="" file_size="" downloads="" time_limit="" download_limit="" limit_action="" limit_action_to_folder=""/>
    ...
    <file id="" name="" description="" password="" folder_id="" download_page_url="" direct_download_url="" upload_time="" file_size="" downloads="" time_limit="" download_limit="" limit_action="" limit_action_to_folder=""/>
</result>           
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=folders.getcontents&session_key=9i96woykgory1crglmykgycjwa5k2cq2&folder_id=0
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found

Method: folders.getShared

Description

Obtains the full contents of a shared folder, including files and any shared sub-folders.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
folder_id Yes A folder_id code or full url
Returns

Folder info, files & sub folders information list

Response

<result method="folders.getShared" status="ok">
    <current id="" name="" parent_folder_id=""/>
    <folder id="" name="" parent_folder_id=""/>
    ...
    <folder id="" name="" parent_folder_id=""/>
    <file id="" name="" description="" folder_id="" upload_time="" file_size=""/>
    ...
    <file id="" name="" description="" folder_id="" upload_time="" file_size=""/>
</result>           
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=folders.getshared&session_key=9i96woykgory1crglmykgycjwa5k2cq2&folder_id=******
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found

Method: folders.getAll

Description

Obtains information about all available folders.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
Returns

Folders information list. See folders.getInfo for structure of a folder-record.

Response

<result method="folders.getAll" status="ok">
    <folder id="" ... />
    ...
    <folder id="" ... />
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=folders.getall&session_key=9i96woykgory1crglmykgycjwa5k2cq2
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found

Method: folders.move

Description

Moves a folder. Can be moved into another folder, or placed in the root.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
folder_id Yes A folder_id code or list of folders' id's (a1a1a1,s2s2s2,d3d3d3)
parent_folder_id Yes folder_id code or 0 for root folder
Returns

Minimal folder information(s) and comma-separated list of IDs suceeded to move in an "id" tag. One or several error messages, optionally containing specific reason and IDs of those folders failed in an "id" property.

Response

<!-- successful response -->
<result method="folders.move" status="ok">
    <id>abcdef,abcdeg</id>
    <folder id="abcdef" />
    <folder id="abcdeg" />
</result>       
									
<!-- failed response -->
<result method="folders.move" status="fail">
    <error code="..." text="Permission denied"/>
</result>
									
<!-- mixed response -->
<result method="folders.move" status="ok">
    <id>abcdef,abcdeg<id>
    <folder id="abcdef" />
    <folder id="abcdeg" />
    <error code="..." text="..." id="abcdeh,abcdek" />
    <error code="..." text="..." id="abcdei,abcdej" />
</result>
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
11 API_ERROR_PERMISSION_DENIED Permission denied
31 API_ERROR_BAD_TARGET_FOLDER Invalid target folder selected

Method: folders.sendMail

Description

Sends the folder link (URL) to the recipient(s), by email.

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
folder_id Yes folder_id or list of folders' id's (a1a1a1,s2s2s2,d3d3d3)
emails Yes List of emails to send
message No Additional message to send the recipients
Returns

ID of the folder if operation was successful

Response

<!-- successful response -->             
<result method="folders.sendMail" status="ok">
    <id>$folder_id</id>
</result>    
 
<!-- failed response -->
<result method="folders.sendmail" status="fail">
        <error code="24" text="Email(s) are invalid"/>
        <id>$folder_id</id>
</result>
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=folders.sendmail&session_key=9i96woykgory1crglmykgycjwa5k2cq2&folder_id=******&emails=webmasteratsendspacedotcom&message=check+this+folder
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
24 API_ERROR_INVALID_EMAIL Email(s) are invalid
Address Book

Method: addressbook.list

Description

Gets entire addressbook information

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
Returns

List of emails

Response

<!-- successful response -->
<result method="addressbook.list" status="ok">
    <contact email="" name="" description="" type="0/1 - 0 = added by user, 1 = collected"/>
    .
    .
    <contact email="" name="" description="" type="0/1 - 0 = added by user, 1 = collected"/>
</result>           
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=addressbook.list&session_key=9i96woykgory1crglmykgycjwa5k2cq2
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found

Method: addressbook.add

Description

Add entry to addressbook

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
email Yes Contact email
name No Contact name
description No Description of contact
type No 0 = added by user, 1 = collected
Returns

New contact information

Response

<!-- successful response -->
<result method="addressbook.add" status="ok">
    <contact email="" name="" description="" type="0/1 - 0 = added by user, 1 = collected"/>
</result>           
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=addressbook.add&session_key=9i96woykgory1crglmykgycjwa5k2cq2&[email protected]&name=test+test&description=friend&type=0
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
24 API_ERROR_INVALID_EMAIL Email(s) are invalid
28 API_ERROR_CONTACT_EXISTS Contact already exists
32 API_ERROR_CONTACTS_LIMIT Reached contacts limit. Please free up unused contacts and try again.

Method: addressbook.update

Description

Update details of a specific addressbook entry

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
email Yes Contact email. cannot be changed. for changing need to use add
name No Only use if you want to change data. Sending empty will clear existing data.
description No Only use if you want to change data. Sending empty will clear existing data.
type No 0 = added by user, 1 = collected
Returns

Current contact details

Response

<!-- successful response -->
<result method="addressbook.update" status="ok">
    <contact email="" name="" description="" type="0/1 - 0 = added by user, 1 = collected"/>
</result>           
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=addressbook.update&session_key=9i96woykgory1crglmykgycjwa5k2cq2&[email protected]&name=tester+tester
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
29 API_ERROR_CONTACT_NOT_EXISTS Contact doesn't exist

Method: addressbook.delete

Description

Delete contacts, searching by email address, can receive list of email addresses

Arguments
Name Mandatory Description
session_key Yes Received from auth.login
email Yes Contact email. cannot be changed. for changing need to use add
Returns

Contact email address if operation was successful

Response

<!-- successful response -->
<result method="addressbook.delete" status="ok">
    <email>$email</email>
</result>           
                
Usage Example
                                           
http://api.sendspace.com/rest/?method=addressbook.delete&session_key=9i96woykgory1crglmykgycjwa5k2cq2&[email protected],[email protected]
                    
                
Possible Errors
Code Name Description
6 API_ERROR_SESSION_BAD Session expired or not found
29 API_ERROR_CONTACT_NOT_EXISTS Contact doesn't exist

Errors

Code Name Description
1 API_ERROR_NO_METHOD No method parameter in request
2 API_ERROR_UNKNOWN_METHOD Unknown method
3 API_ERROR_SESSION_KEY_MISSING Session key parameter missing
4 API_ERROR_PARAMETER_MISSING Method parameter(s) missing
5 API_ERROR_BAD_API_VERSION Unknown or unsupported API version
6 API_ERROR_SESSION_BAD Session expired or not found
7 API_ERROR_SESSION_NOT_AUTH Session not authenticated
8 API_ERROR_AUTHENTICATION_FAILURE Authentication error
9 API_ERROR_FILE_NOT_FOUND File not found
10 API_ERROR_FOLDER_NOT_FOUND Folder not found
11 API_ERROR_PERMISSION_DENIED Permission denied
12 API_ERROR_DOWNLOAD_TEMP_ERROR Download is temporarily unavailable
13 API_ERROR_UPLOAD_TEMP_ERROR Upload is temporarily unavailable
14 API_ERROR_FOLDER_NOT_EMPTY Folder is not empty
15 API_ERROR_SYSTEM_MAINTENANCE System maintenance, try again later
16 API_ERROR_INVALID_PARAMETER One of the parameters is invalid
17 API_ERROR_HTTPS_FORBIDDEN HTTPS is forbidden for current user
18 API_ERROR_UNKNOWN_API_KEY Unknown API key sent
19 API_ERROR_PRO_EXPIRED Pro user, account expired
20 API_ERROR_PRO_DISKSPACE_LIMIT Pro user, reached disk space limit
21 API_ERROR_PARAMETER_BAD_VALUE One of the parameter values is invalid
22 API_ERROR_BAD_PASSWORD A wrong or empty password was given
23 API_ERROR_BANDWIDTH_LIMIT Account bandwidth limit reached
24 API_ERROR_INVALID_EMAIL Email(s) are invalid
25 API_ERROR_OUTDATED_VERSION The application version you are using is too old. Please upgrade it.
26 API_ERROR_INVALID_FILE_URL Not a sendspace download URL (must start with http://www.sendspace.com/ and contain a 6 character link)
27 API_ERROR_REGISTRATION_ERROR * A specific text message will be sent according to the error *
28 API_ERROR_CONTACT_EXISTS Contact already exists
29 API_ERROR_CONTACT_NOT_EXISTS Contact doesn't exist
30 API_ERROR_TOO_MANY_SESSIONS Too many sessions open for your user account. Please close previous sessions.
31 API_ERROR_BAD_TARGET_FOLDER Invalid target folder selected
32 API_ERROR_CONTACTS_LIMIT Reached contacts limit. Please free up unused contacts and try again.
33 API_ERROR_FOLDER_IS_PRIVATE Folder is private. Only the owner can view.

Title

Alert