Summary |
Upload a source media or resource file to be used in an order. |
URL |
/api/v1/inputs |
Detailed Description |
Use this operation to send files to be used in a future order 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 file which you can then refer to when submitting a new order.
There are three ways to transfer the file:
- Upload it directly. To do so, send the file 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 file.
- Upload the file using a multipart request. Set Content-Type to "multipart/form-data".
The multipart request must have exactly
one file part which should contain the file data. The filename is taken from the
filename component of the Content-Disposition header for this part.
To specify the content type for the file, 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 file.
The URL must be publicly accessible.
|
Request Headers |
-
Authorization - Contains client/user API keys
-
Content-Type - If the file is being directly uploaded, this should be the content
type for the file. If the file is to be retrieved, this should be application/xml
or application/json. Also supported is multipart/form-data, with
a single part containing the file.
-
Content-Disposition - If the file is being directly uploaded, then this should
be of the form
Content-Disposition: attachment; filename="file_name.ext" . The filename
should include the extension type. The name for the input file will be taken from this header.
For multipart or JSON/XML requests, this header is not required.
-
x-rev-isresource (optional) - This is to be used for resource files in
Transcription orders. If the file is considered to be a resource file,
this should be set to
true . A resource file is a file that can be uploaded
alongside a source media file when placing an order to provide additional information and help
progress the order faster.
For Legal Transcription orders, please review the Legal Resources
section of the Submit New Legal Transcription Order
page for more information on acceptable content types per resource type.
|
Request Body |
The binary data contents of the file, or a multipart body with one part containing
the binary contents of the file, or an XML/JSON entity specifying a location
from which the file can be retrieved. |
Response |
On success, 201 Created.
On error, 400 Bad Request.
|
Response Headers |
- Location – URI identifying the newly uploaded file. This URI can be used to identify
this file 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 file is not currently
supported by our system. Currently supported source media 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 file was not explicitly specified
and could not be determined automatically.
- 10005 Unspecified URL - If the url for the file 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 file.
The multipart tab shows a sample multipart upload request.
For uploading file content directly, the request entity should be the file data
{
/*
Optional, the content type of the file 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 file. If not specified, we will
determine it from the URL
*/
"filename": "video.mp4",
/*
Mandatory, URL where the file 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 file 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 file. If not specified, we will
determine it from the URL
-->
<filename>video.mp4</filename>
<!--
Mandatory, URL where the file 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--
|