Show examples as:

The SesameVault API « Back to Developer Page

You can use the API to upload video files to your SesameVault account. To do this, you would send the file as a multipart-encoded POST request to the following URL:

http://www.sesamevault.com/upload/new/file

The form field containing the file should be named upload_file.

Before you upload the file, you must generate an upload key (which you can also use to track the progress of the upload as it happens). This upload key is sent along with the upload request.

To create a new upload key, call:

http://www.sesamevault.com/upload/new_upload_key.xml

Which would return something like this:

  <results>
    <upload_key>0ea1c488-b524-4e17-80ad-86a868a50e9c</upload_key>
  </results>

You would then include this key in the file upload URL as a query parameter:

http://www.sesamevault.com/upload/new/file?upload_key=0ea1c488-b524-4e17-80ad-86a868a50e9c

Also be sure to include a signature with this URL so that the upload will be properly authorized by SesameVault. Once the upload is complete, the video will be in your Vault and will automatically start encoding.

Upload Progress

To get the status of a currently-uploading file, send a GET request to:

http://www.sesamevault.com/upload/progress.xml

Be sure to include the appropriate upload key in the request. For example:

http://www.sesamevault.com/upload/progress.xml?upload_key=0ea1c488-b524-4e17-80ad-86a868a50e9c

This should return the number of bytes transfered so far and the total size of the file being uploaded, like so:

  <results>
    <status>
      <received>123300</received>
      <size>3244092</size>
    </status>
  </results>

When the upload is complete, the progress returns the id of the newly created video as an additional parameter (which should be the same as the upload_key):

  <results>
    <video_id>0ea1c488-b524-4e17-80ad-86a868a50e9c</video_id>
    
    <status>
      <received>3244092</received>
      <size>3244092</size>
    </status>
  </results>

Deleting Videos

To delete one of your videos, use /video/delete:

http://www.sesamevault.com/video/delete/[VIDEO ID].xml

Which, if successful, would return something like this:

  <video>
    <id>[VIDEO ID]</id>
    <deleted>true</deleted>
  </video>

Be warned: once a video has been deleted, it is gone forever (into that big movie theater in the sky).