Operations

POST /inputs

Summary Upload a source file to be used in an order.
URL /api/v1/inputs
Detailed Description

Use this operation to send files to be transcribed or captioned by Rev.

You must specify the filename and content type for the file. Upon successful completion, the Location response header will contain the URI for the media which you can refer to the media when submitting a new order.

There are three ways to transfer the media:

  • Upload it directly. To do so, send the media data as the body of the post. Set the Content-Type header appropriately and use the Content-Disposition header to specify the filename for the media.
  • Upload the media using a multipart request. Set Content-Type to "multipart/form-data". The multipart request must have exactly one file part which should contain the media data. The filename is taken from the filename component of the Content-Disposition header for this part. To specify the content type for the media, either use the Content-Type header for the file part, or include a form field part with the name "Content-Type".
  • Have us retrieve the data from a server of your choice. To do so, send a XML or JSON entity, as shown in the "sample request entity" section below. This will give us the URL and optionally the filename and content-type for the media. The URL must be publicly accessible.

Request Headers
  • Authorization - contains client/user API keys
  • Content-Type - if the media is being directly uploaded, this should be the content type for the media. If the media is to be retrieved, this should be application/xml or application/json. Also supported is multipart/form-data, with a single part containing the media.
  • Content-Disposition - If the media is being directly uploaded, then this should be of the form "Content-Disposition: attachment; filename="fname.ext". The filename for the input media will be taken from this header. For multipart or JSON/XML requests, this header is not required.
Request Body The binary data contents of the media file, or a multipart body with one part containing the binary contents of the media file, or an XML/JSON entity specifying a location from which the media can be retrieved.
Response On success, 201 Created.
On error, 400 Bad Request.
Response Headers
  • Location – URI identifying the newly uploaded media. This URI can be used to identify this media when submitting an order.
Response Body On success, empty. On error, will contain an <error/> entity with more details.
Error Codes
  • 10001 Unsupported Content Type – if the content type of the media is not currently supported by our system. Currently supported content types are:

    - audio/aac
    - audio/mp3
    - audio/mp4
    - audio/mp4a
    - audio/mp4a-latm
    - audio/mpeg
    - audio/mpeg3
    - audio/ogg
    - audio/vnd.wave
    - audio/vorbis
    - audio/wav
    - audio/webm
    - audio/x-aac
    - audio/x-aifc
    - audio/x-aiff
    - audio/x-m4a
    - audio/x-mpeg-3
    - audio/x-realaudio
    - audio/x-wav
    - video/avi
    - video/mp4
    - video/mpeg
    - video/msvideo
    - video/ogg
    - video/quicktime
    - video/webm
    - video/x-flv
    - video/x-m4v
    - video/x-matroska
    - video/x-mpeg
    - video/x-ms-wmv
    - video/x-msvideo

  • 10002 Could not retrieve file – if we could not retrieve the file from the specified location.
  • 10003 Invalid multipart request – If the multipart request did not contain exactly one file part, or was otherwise malformed.
  • 10004 Unspecified filename - If the filename for the media was not specified explicitly and could not be determined automatically.
  • 10005 Unspecified URL - If the url for the media was not specified.
Annotated sample request for transcription or captioning

This JSON and XML tabs shows a sample request entity for specifying a location from which to retrieve the media.

The multipart tab shows a sample multipart upload request.

For uploading media content directly, the request entity should be the media data

{
    /*
        Optional, the content type of the media to be retrieved.
        If not specified, we will try to determine it from the server response
    */
    "content_type": "video/mpeg",
    /*
        Optional, the filename for the media. If not specified, we will
        determine it from the URL
    */
    "filename": "video.mp4",
    /*
        Mandatory, URL where the media can be retrieved. Must be publicly
        accessible. HTTPS urls are ok as long as the site in question has
        a valid certificate
    */
    "url": "http://www.server.com/file/987834"
}
                    
<media_request>
    <!--
        Optional, the content type of the media to be retrieved.
        If not specified, we will try to determine it from the server response
    -->
    <content_type>video/mpeg</content_type>
    <!--
        Optional, the filename for the media. If not specified, we will
        determine it from the URL
    -->
    <filename>video.mp4</filename>
    <!--
        Mandatory, URL where the media can be retrieved. Must be publicly
        accessible. HTTPS urls are ok as long as the site in question has
        a valid certificate
    -->
    <url>http://www.server.com/file/987834</url>
</media_request>
                
--aa--
Content-Disposition: form-data; name="example"; filename="video.mp4"
Content-Type: video/mpeg
file data
--aa--