REST API‎ > ‎

File Upload

Media file upload is supported via the "forklift" web application.  Media files up to 25MB in size may be uploaded.  The upload is accomplished via a POST of a multipart/form-data form.

In order to upload a file, you must have a valid upload grant code; accounts will be limited to the amount of daily uploads and total size allowed for uploads.  Currently accounts are limited to 100 uploaded files.

Method: POST
URI: /forklift/

Form parameters:
  • grant - The grant code previously created via the "request upload grant" method
  • mediafile - The file data.
Response codes are returned as HTTP status and also as a three-character text/plain code in the response body.  Possible status values:
  • OK(200) - The upload succeeded.
  • BAD_REQUEST(400) - Either the grant code or the file data is missing.
  • NOT_FOUND(404) - The grant code is invalid.
  • REQUEST_ENTITY_TOO_LARGE(413) - The file is larger than the allowed limit.
  • UNSUPPORTED_MEDIA_TYPE(415) - The file is not an MP3 file.  Only MP3 files may be uploaded at this time.
  • INTERNAL_SERVER_ERROR(500) - All other errors.
Response format: text/plain
The response text is an HTTP URL to the newly-uploaded media.  The media is immediately available using this URL.  

Note that the URI for production media is "media.telesocial.com" whereas the sandbox will return "mediasb.telesocial.com" 

Example:
http://media.telesocial.com/audio/56c07bfe8f0255e77fe83986b7bffcd7/1700614602.mp3

A file upload example illustrated with an HTML form:

<form method="post" enctype="multipart/form-data" action="http://api4.bitmouth.com/forklift">
<input type="text" name="grant"/>
<input type="file" name="mediafile"/>
</form>