Upload with an upload token

When given a token, anyone can upload a file to the URI https://ws.api.video/upload?token=<tokenId>.

Example with cURL:

$ curl  --request POST --url 'https://ws.api.video/upload?token=toXXX'
 --header 'content-type: multipart/form-data'
 -F [email protected]

Or in an HTML form, with a little JavaScript to convert the form into JSON:

<!--form for user interaction-->
<form name="videoUploadForm" >
  <label for=video>Video:</label>
  <input type=file name=source/><br/>
  <input value="Submit" type="submit">
<!--JS takes the form data 
    uses FormData to turn the response into JSON.
    then uses POST to upload the video file.
    Update the token parameter in the url to your upload token.
   var form = document.forms.namedItem("videoUploadForm");  
   form.addEventListener('submit', function(ev) {
     var oOutput = document.querySelector("div"),
         oData = new FormData(form);
     var oReq = new XMLHttpRequest();
     oReq.open("POST", "https://ws.api.video/upload?token=toXXX", true);
     oReq.onload = function(oEvent) {
       if (oReq.status ==201) {
         oOutput.innerHTML = "Your video is uploaded!<br/>"  + oReq.response;
       } else {
         oOutput.innerHTML = "Error " + oReq.status + " occurred when trying to upload your file.<br \/>";
   }, false);   

Dealing with large files

You can upload large files on api.video with Progressive Upload. Alternatively, if you want to use regular upload, we have created a tutorial to walk through the steps required.

Click Try It! to start a request and see the response here!