Upload Video to TelVue Connect via REST API

July 19, 2012, 17:43 by rbrooks

Uploading videos to Connect programmatically from other systems is very simple and secure.

Using your favorite HTTP tool or library, make a POST request to https://connect.telvue.com/assets/upload and include HTTP Basic Authentication credentials for any user in your Connect account.

Examples

cURL

The popular cURL tool comes bundled with any Linux, Mac, or UNIX operating system.

Assuming you have a Connect user account, “jsmith”, with the password, “pass”, and a video called “MyVideo.mp4” in the current directory:

curl -F "files[]=@MyVideo.mp4" --user jsmith:pass \
https://connect.telvue.com/assets/upload.json

Log in to Connect as that user, visit the “My Media” page, and you will see the uploaded video.

Ruby

Here is an example in Ruby 1.9+ using the REST-Client gem (gem install rest-client). Change user, password, and file accordingly:

require 'rubygems'
require 'rest-client'
 
request = RestClient::Request.new(
  method: :post,
  url: 'https://connect.telvue.com/assets/upload',
  user: 'jsmith',
  password: 'pass',
  payload: {
    multipart: true,
    file: File.new('MyVideo.mp4', 'rb')
  }
)
response = request.execute

Note your password, although visible above, is not sent in plain text. Like the video you are uploading, SSL also encrypts the password.

Connect’s REST API will be formally documented iteratively over time. This is just the first piece.

Facebooktwittergoogle_pluslinkedin

Leave a Reply