|
sendspace API (beta) Developer GuideThe sendspace Application Programming Interface (API) allows you to embed sendspace services in your applications, programs, or scripts, regardless of platform and programming language. |
| Name | Mandatory | Description |
| session_key | Yes | Received from auth.login |
| speed_limit | No | Upload speed limit in kilobytes, 0 for unlimited |
<result method="upload.getInfo" status="ok"> <upload url="" progress_url="" max_file_size="" upload_identifier="" extra_info="" /> </result>
http://api.sendspace.com/rest/?method=upload.getinfo&session_key=9i96woykgory1crglmykgycjwa5k2cq2&speed_limit=0
| 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 |
<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="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>
upload_status=ok/fail file_id=XXXX bandwidth_left=bytes/-1(=unlimited) diskspace_left=bytes/-1(=unlimited)
<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>
<? header("Content-type: text/xml"); echo file_get_contents($_REQUEST['url']); ?>