{"_id":"59796d1140a3a2001f068cb9","category":{"_id":"59796d1140a3a2001f068cb6","version":"59796d1140a3a2001f068cb4","project":"5669937dfc5abf2300afe7de","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-12-23T15:52:27.836Z","from_sync":false,"order":1,"slug":"foo","title":"Core"},"user":"54bd5e07b336d20c00dbd211","parentDoc":null,"project":"5669937dfc5abf2300afe7de","version":{"_id":"59796d1140a3a2001f068cb4","project":"5669937dfc5abf2300afe7de","__v":2,"createdAt":"2017-07-27T04:33:21.278Z","releaseDate":"2017-07-27T04:33:21.278Z","categories":["59796d1140a3a2001f068cb5","59796d1140a3a2001f068cb6","59796d1140a3a2001f068cb7","59796d1140a3a2001f068cb8","5acb7bc606a2ce0003f28da4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"githubsync":"","__v":3,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-11T18:42:54.484Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"method":"post","results":{"codes":[{"status":200,"language":"json","code":"{\n  \"fileUrl\": \"https://s3.amazonaws.com/ingest-east.mediasilo.com/0da26ebf6ac240c0b49bfc9f34b7d775/myVideo.mov\",\n  \"amzDate\": \"Tue, 11 Oct 2016 18:35:07 GMT\",\n  \"amzAcl\": \"private\",\n  \"authorization\": \"AWS AKIAIBTQICBLRC7JU6RA:BDwvt82IDsMtZZLUyeD239mhQwQ=\",\n  \"httpMethod\": \"PUT\"\n}","name":""}]},"settings":"","examples":{"codes":[{"language":"json","code":"{\n\t\"fileName\" : \"myVideo.mov\",\n  \"contentType\": \"octet/stream\"\n}"}]},"auth":"required","params":[{"_id":"5abe40a65212fd0012d9740b","ref":"","in":"body","required":true,"desc":"The name of the file you want to upload","default":"","type":"string","name":"fileName"},{"_id":"5abe40a65212fd0012d9740a","ref":"","in":"body","required":true,"desc":"The mime type for the video that you are uploading. (http://www.iana.org/assignments/media-types/media-types.xhtml#video)","default":"","type":"string","name":"contentType"}],"url":"/videos/upload"},"isReference":true,"order":0,"body":"This endpoint exists for securely uploading videos into SafeStream. There is no static location for uploading videos into SafeStream. Instead, you can use this point to request an upload URL. This endpoint will return an upload URL as well as the credentials needed to upload to the given URL.\n\nOnce you have a response from this endpoint use it to upload your video to the URL provided. Below is an example of uploading to SafeStream using the response from this endpoint.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -i -X PUT \\\"[FILE_URL_FROM_UPLOAD_RESPONSE]\\\" -H \\\"Authorization: [AUTHORIZATION_FROM_UPLOAD_RESPONSE]*\\\" -H \\\"x-amz-acl: [AMZ_ACL_FROM_UPLOAD_RESPONSE]\\\" -H \\\"x-amz-date: [AMZ_DATE_FROM_UPLOAD_RESPONSE]\\\" -H 'Content-Type: [CONTENT-TYPE-FROM-UPLOAD-REQUEST]' -T /videos/myVideo.mov\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"function uploadFile(fileObject) {\\n  xhr = new XMLHttpRequest();\\n  xhr.open('PUT', '[FILE_URL_FROM_UPLOAD_RESPONSE]', true);\\n  xhr.setRequestHeader('x-amz-date', 'AMZ_DATE_FROM_UPLOAD_RESPONSE');\\n  xhr.setRequestHeader('Authorization', 'AUTHORIZATION_FROM_UPLOAD_RESPONSE');\\n  xhr.setRequestHeader('x-amz-acl', 'AMZ_ACL_FROM_UPLOAD_RESPONSE');\\n  xhr.send(fileObject);\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Check the Response\",\n  \"body\": \"A 200 HTTP response status indicates that the video was uploaded and you should continue to [ingest the video](doc:video) using the same file URL.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Auth Problems\",\n  \"body\": \"If you received a 401 or 403 response when trying to upload your file, check to be sure that all fields in the upload PUT request match the response from original upload request. Inconsistencies in these fields will result in a failure to authenticate or authorize.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Uploading to SafeStream is recommended but not required\",\n  \"body\": \"The endpoint for [ingesting a video](doc:video) only requires that the **sourceUrl** is accessible to SafeStream. Public URL's can be ingested without having been uploaded to SafeStream first.\"\n}\n[/block]","excerpt":"Provides an upload ticket that allows you to upload a video to a secure location where SafeStream can ingest it.  This method supports video files up to 5GB in size.","slug":"upload-a-video-for-ingest","type":"endpoint","title":"Upload a video"}

postUpload a video

Provides an upload ticket that allows you to upload a video to a secure location where SafeStream can ingest it. This method supports video files up to 5GB in size.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

fileName:
required
string
The name of the file you want to upload
contentType:
required
string
The mime type for the video that you are uploading. (http://www.iana.org/assignments/media-types/media-types.xhtml#video)

Examples


Result Format


Documentation

This endpoint exists for securely uploading videos into SafeStream. There is no static location for uploading videos into SafeStream. Instead, you can use this point to request an upload URL. This endpoint will return an upload URL as well as the credentials needed to upload to the given URL. Once you have a response from this endpoint use it to upload your video to the URL provided. Below is an example of uploading to SafeStream using the response from this endpoint. [block:code] { "codes": [ { "code": "curl -i -X PUT \"[FILE_URL_FROM_UPLOAD_RESPONSE]\" -H \"Authorization: [AUTHORIZATION_FROM_UPLOAD_RESPONSE]*\" -H \"x-amz-acl: [AMZ_ACL_FROM_UPLOAD_RESPONSE]\" -H \"x-amz-date: [AMZ_DATE_FROM_UPLOAD_RESPONSE]\" -H 'Content-Type: [CONTENT-TYPE-FROM-UPLOAD-REQUEST]' -T /videos/myVideo.mov", "language": "curl" }, { "code": "function uploadFile(fileObject) {\n xhr = new XMLHttpRequest();\n xhr.open('PUT', '[FILE_URL_FROM_UPLOAD_RESPONSE]', true);\n xhr.setRequestHeader('x-amz-date', 'AMZ_DATE_FROM_UPLOAD_RESPONSE');\n xhr.setRequestHeader('Authorization', 'AUTHORIZATION_FROM_UPLOAD_RESPONSE');\n xhr.setRequestHeader('x-amz-acl', 'AMZ_ACL_FROM_UPLOAD_RESPONSE');\n xhr.send(fileObject);\n}", "language": "javascript" } ] } [/block] [block:callout] { "type": "info", "title": "Check the Response", "body": "A 200 HTTP response status indicates that the video was uploaded and you should continue to [ingest the video](doc:video) using the same file URL." } [/block] [block:callout] { "type": "danger", "title": "Auth Problems", "body": "If you received a 401 or 403 response when trying to upload your file, check to be sure that all fields in the upload PUT request match the response from original upload request. Inconsistencies in these fields will result in a failure to authenticate or authorize." } [/block] [block:callout] { "type": "warning", "title": "Uploading to SafeStream is recommended but not required", "body": "The endpoint for [ingesting a video](doc:video) only requires that the **sourceUrl** is accessible to SafeStream. Public URL's can be ingested without having been uploaded to SafeStream first." } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}