| Paging Parameter | Description |
|---|---|
| page_id | The zero-based identifier of the page to return Example: page_id=3 |
| page_size | The number of results to return per page. The default and maximum page size is 500. Example: page_size=100 |
| sort_by | The field by which the results should be sorted. Results can be sorted by any of the following: publish_date, create_date, update_date Example: sort_by=publish_date |
| sort_order | The order in which the results should display. Specify 'asc' for ascending or 'desc' for descending. Results will display in ascending order by default. Example: sort_order=desc |

| Property Name | Required on Create | Updatable | Description | Limited to Values |
|---|---|---|---|---|
| id | Automatically Set | NO | A unique identifier for a channel group. Limelight automatically assigns an ID upon creation | n/a |
| title | YES | YES | The name of the channel group | n/a |
| update_date | Automatically Set | NO | The date the channel group was last updated (this includes the last time a channel was added/removed from the channel group), represented as the number of seconds since the Unix epoch | n/a |
| create_date | Automatically Set | NO | The date the channel group was created, represented as the number of seconds since the Unix epoch | n/a |
| Property Name | Required on Create | Updatable | Description | Limited to Values |
|---|---|---|---|---|
| id | Automatically Set | NO | A unique identifier for a channel. Limelight automatically assigns an ID upon creation | n/a |
| title | YES | YES | The name of the channel | n/a |
| description | NO | YES | A description of the channel | n/a |
| thumbnail_url | NO | NO | The URL of the thumbnail image associated with the channel | n/a |
| state | Automatically Set | YES | Current state of the channel. Limelight automatically sets this to 'NotPublished' upon create. To publish a channel, first create it and then perform an update to set the state to 'Published.' | Published, NotPublished |
| email_enabled | NO | YES | An indicator that enables share with a friend functionality | true, false |
| embed_enabled | NO | YES | An indicator that enables get embed code functionality | true, false |
| search_inside_enabled | NO | YES | An indicator that enables search inside functionality | true, false |
| autoplay_enabled | NO | YES | An indicator that enables autoplay functionality | true, false |
| rss_enabled | NO | YES | An indicator that enables RSS functionality | true, false |
| itunes_rss_enabled | NO | YES | An indicator that enables iTunes functionality | true, false |
| publish_date | NO | NO | The date the channel was last set to 'Published', represented as the number of seconds since the Unix epoch. Value will be blank if channel is not published. | n/a |
| update_date | Automatically Set | NO | The date the channel was last updated (this includes the last time a media was added/removed from the channel), represented as the number of seconds since the Unix epoch | n/a |
| create_date | Automatically Set | NO | The date the channel was created, represented as the number of seconds since the Unix epoch | n/a |
| Property Name | Required on Create | Updatable | Description | Limited to Values |
|---|---|---|---|---|
| id | Automatically Set | NO | A unique identifier for a media. Limelight automatically assigns an ID upon creation | n/a |
| title | YES | YES | The name of the media | n/a |
| description | NO | YES | A description of the media | n/a |
| media_type | Automatically Set | NO | The type of media. Limelight automatically sets this value | Video, Audio, LiveStream |
| original_filename | Automatically Set | NO | The original name of the file that was uploaded | n/a |
| state | Automatically Set | NO | Current state of the video. Limelight automatically sets this value | New, Uploading, Processing, Publishable, Published, Error |
| duration_in_milliseconds | Automatically Set | NO | The length of the video in milliseconds. Limelight automatically sets this value | n/a |
| total_storage_in_bytes | Automatically Set | NO | The total number of bytes used to store the video. This value reflects the storage of the originally uploaded source plus all transcoded files | n/a |
| category | NO | YES | The genre associated with the media | Politics, Entertainment, Travel, Sports, Technology, Gaming, Business |
| ref_id | NO | YES | A free-form field that can house an internally used media reference ID, possibly from an existing CMS | n/a |
| restrictionrule_id | NO | YES | The unique ID of the viewing restriction rule that is assigned to the media. A restriction rule represents the listing of approved domains and/or geographic locations where a media can be played. A restriction rule can be setup under 'Settings -> Content Restrictions' in your account. | n/a |
| closed_captions_url | NO | YES | The URL to the caption file that is associated with the media. | n/a |
| allow_ads | NO | YES | A true/false field that indicates if ads can play for a media. A value of 'false' will prevent any ads from playing for the media. | true, false |
| thumbnails | Automatically Set | NO | A list of URLs associated with the different thumbnail image sizes for the video. A video will have two thumbnail sizes, a small (width of 120) and a large (width of 540). The width of the large size can be customized by uploading your own image in the Limelight Video Platform console | n/a |
| tags | NO | YES | A list of strings representing the tags of the video | n/a |
| sched_start_date | NO | YES | The date the video is scheduled to be available for viewing, represented as the number of seconds since the Unix epoch | n/a |
| sched_end_date | NO | YES | The date the video is scheduled to become unavailable for viewing, represented as the number of seconds since the Unix epoch | n/a |
| publish_date | NO | NO | The date the video was 'Published', represented as the number of seconds since the Unix epoch. A media is set to 'Published' when it first exists in a 'Published' channel. Value will be blank if the video is not published. | n/a |
| update_date | Automatically Set | NO | The date the media was last updated, represented as the number of seconds since the Unix epoch | n/a |
| create_date | Automatically Set | NO | The date the media was created in the account, represented as the number of seconds since the Unix epoch | n/a |
Search for media
Find and list media that meet specified search criteria
NOTE: See Appendix A for specific examples that illustrate the use of search
| Key | Value |
|---|---|
| title | Any word or phrase in the title. |
| description | Any word or phrase in the description. |
| original_filename | Any word or phrase in the original filename. |
| tag | Any word or phrase in the tag. |
| state | Exact match of one of the following: new, uploading, processing, publishable, published, error |
| media_type | Exact match of one of the following: video, audio, livestream |
| channel_id | Id of a channel where the search should be limited. |
| created_after | Date, represented in Unix Time. Limits search to media created after a particular date. |
| updated_after | Date, represented in Unix Time. Limits search to media updated after a particular date. |
| published_after | Date, represented in Unix Time. Limits search to media published after a particular date. |
| custom_property[<custom_property_id>] The ID of a custom property can be found by accessing 'Settings' then 'Custom Properties' in the LVP console. Right-click on the property name to reveal. Click to copy. |
Any word or phrase in the value of the custom property |
List all properties for a specific media
Find and list all properties for a specific media
Get the value of a particular media property
Find and get the value of a media property
List all channels that contain a specific media
Find and get a list of all the channels that contain a specific media
List the cue points for a specific media
Find and get the details for all cue points on a media
List the encodings for a specific media
Find and get the details, including playback URLs, for all the transcoded files that have been produced for a media
List the encodings for all media
Find and get the details, including playback URLs, for all the transcoded files for all media in an account
List the thumbnails for a specific media
Find and get the details for all skimming thumbnails that have been produced for a media. These are the images that are automatically produced when a media is uploaded - one image for each ten seconds of content.
List published channels
Find and list all 'published' channels in an account
List all channels
Find and list all channels, including 'unpublished' channels
List all properties for a channel
Find and list all properties for a specific channel
Get the value of a particular channel property
Find and get the value of a channel property
List all media associated with a channel
Find and get all media in a particular channel
List the encodings for a specific channel
Find and get the details, including playback URLs, for all the transcoded files for all media in a particular channel
List all channel groups
Find and list all channel groups in an account
List all properties of a channel group
Find and list all properties for a specific channel group
List all channels in a channel group
Find and get all published channels in a particular channel group
List all restriction rules
Find and list all the viewing restriction rules for an account.
Upload media
Upload media to an account
Note: The content-type of this method should be multipart/form-data in order to upload a binary file
POST /rest/organizations/<ORG ID HERE>/media?access_key=<ACCESS KEY HERE>&expires=1262655732&signature=<SIGNATURE HERE> HTTP/1.1 Host: api.video.limelight.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryzn5sSWPDvmHE6QPU Content-Length: 3532404 ------WebKitFormBoundaryzn5sSWPDvmHE6QPU Content-Disposition: form-data; name="title" My Media Title ------WebKitFormBoundaryzn5sSWPDvmHE6QPU Content-Disposition: form-data; name="description" My Media Description ------WebKitFormBoundaryzn5sSWPDvmHE6QPU Content-Disposition: form-data; name="media_file"; filename="MyVideoFile.mp4" Content-Type: video/mp4 <BINARY DATA OF FILE WOULD BE HERE> ------WebKitFormBoundaryzn5sSWPDvmHE6QPU--
Create a new channel
Create a new channel in an account
Create a new channel group
Create a new channel group in an account
Set one or more properties for a media
Update media properties for a specific media
Note: This does not apply to custom properties. To set custom properties, see section 7.0 below
Add a tag to an existing media
Append a tag to an existing media
Note: This differs from the "Set one or more properties for a media" method in that setting a tag via this method does not remove existing tags
Add a closed captions file to a media
Upload a DFXP closed captions file for an existing media
Publish/Unpublish a Media
Request that a media be 'published' or 'unpublished'.
Note: You are not explicitly setting the state of the media with a call to this API. You are simply submitting a request that the media be 'published' or 'unpublished'. Upon request, the system will take care of setting the media state when appropriate. For example, if a media is currently 'uploading' or 'processing' and a request is made to 'publish' then the system will queue the request until the media has completed uploading and processing.
Set one or more properties for a channel
Update channel properties for a specific channel
Add existing media to a channel
Place existing media into an existing channel
NOTE: A channel can contain no more than 7000 media. Once a channel reaches 7000 media calls to this API will be ignored.
Set a property for a channel group
Update the channel group title
Add an existing channel to a channel group
Place an existing channel into an existing channel group
Delete a media
This method will remove a specific media from an account
Remove a tag from an existing media
Deletes a tag form the list of tags for a media
Unset a single media property
Unsetting a media property will return it to the default value
Remove a closed captions file
Remove a closed captions file from a specific media
Delete a channel
This method will not delete the media within the channel from the account, only the channel will be deleted
Remove media from a channel
Remove a specific media from a specific channel
Unset a single channel property
Unsetting a channel property will return it to the default value
Delete a channel group
This method will not delete the channels within the channel group, only the channel group itself will be deleted
Remove a channel from a channel group
Remove a specific channel from a specific channel group
Create media custom property
Add a custom media property to an account. The following types of custom properties can be created:
-- Text (the value of the custom property is free-form text)
-- List (the value of the custom property is limited to a predefined list)
Update media custom property
Update the details of a custom property including renaming, changing the type (text or list) or updating the list of possible values
Delete media custom property
Remove a custom property from an account.
Note: Before deleting a custom property you may want to find out if the property is used. See the following method below: "Count the number of media with a value for a property"
Assign a value to a custom property for a media
Add a value for a custom property for an existing media
Un-assign a value to a custom property for a media
Set the value of a custom property back to blank
List all custom property names in an account
Get a list of all custom property names in an account
List all custom properties and details in an account
Get a list of all custom properties and details, including type and default list values
Get the value for a custom property for a media
Get the value of a particular custom property for a media
Count the number of media with a value for a property
Get a count of the number of media currently with an assigned value for a custom property.
Note: This method is useful for determining the use of a custom property before deleting.
Create channel custom property
Add a custom channel property to an account. The following types of custom properties can be created:
-- Text (the value of the custom property is free-form text)
-- List (the value of the custom property is limited to a predefined list)
Update channel custom property
Update the details of a channel custom property including renaming, changing the type (text or list) or updating the list of possible values
Delete channel custom property
Remove a custom channel property from an account.
Note: Before deleting a custom property you may want to find out if the property is used. See the following method below: "Count the number of media with a value for a property"
Assign a value to a custom property for a channel
Add a value for a custom property for an existing channel
Un-assign a value to a custom property for a channel
Set the value of a custom property back to blank
List all custom channel property names in an account
Get a list of all custom channel property names in an account
List all custom channel properties and details in an account
Get a list of all custom channel properties and details, including type and default list values
Get the value for a custom property for a channel
Get the value of a particular custom property for a channel
Count the number of channels with a value for a property
Get a count of the number of channels currently with an assigned value for a custom property.
Note: This method is useful for determining the use of a custom property before deleting.
Create a channel group custom property
Add a custom channel group property to an account. The following types of custom properties can be created:
-- Text (the value of the custom property is free-form text)
-- List (the value of the custom property is limited to a predefined list)
Update a channel group custom property
Update the details of a custom property including renaming, changing the type (text or list) or updating the list of possible values
Delete a channel group custom property
Remove a custom property from an account.
Note: Before deleting a custom property you may want to find out if the property is used. See the following method below: "Count the number of channel groups with a value for a property"
Assign a value to a custom property for a channel group
Add a value to a custom property for an existing channel group
Un-assign a value to a custom property for a channel group
Set the value of a custom property back to blank
List all custom property names in an account
Get a list of all channel group custom property names in an account
List all custom properties and details in an account
Get a list of all custom properties and details, including type and default list values for channel groups
Get the value for a custom property for a channel group
Get the value of a particular custom property for a channel group
Count the number of channel groups with a value for a property
Get a count of the number of channel groups currently with an assigned value for a custom property.
Note: This method is useful for determining the use of a custom property before deleting.
| Org ID: | bfb3caa8e6204fea9a23ce855768fc93 |
| Access Key: | ezU4jGTelX8UAsfaiWUcjWsn1mY= |
| Secret: | +IEbSWOctQhaMi7DGop9KdPysqw= |
| Expires: | 1298347550 |
http://api.video.limelight.com/rest/organizations/bfb3caa8e6204fea9a23ce855768fc93/channels
post|api.video.limelight.com|/rest/organizations/bfb3caa8e6204fea9a23ce855768fc93/channels|
post|api.video.limelight.com|/rest/organizations/bfb3caa8e6204fea9a23ce855768fc93/channels|access_key=ezU4jGTelX8UAsfaiWUcjWsn1mY=&expires=1298347550
z+JfIdl/O0exxTPkyAaz89BnQSrDpv8x8up1Vq/IeE0=
http://api.video.limelight.com/rest/organizations/bfb3caa8e6204fea9a23ce855768fc93/channels?access_key=ezU4jGTelX8UAsfaiWUcjWsn1mY%3D&expires=1298347550&signature=z%2BJfIdl%2FO0exxTPkyAaz89BnQSrDpv8x8up1Vq%2FIeE0%3D
| PHP | LvpAuthUtil.php |
| Ruby | LvpAuthUtil.rb |
| Java | LvpAuthUtil.java |
| C# | LvpAuthUtil.cs |
| VB | LvpAuthUtil.vb |
| Python | LvpAuthUtil.py |
require 'net/http'
require 'yaml'
require 'pp'
org_id = '<your org here>'
yaml_text =
Net::Http.get(URI.parse("http://api.video.limelight.com/rest/organizations/
{org_id}/channels.yaml")
pp YAML::load(yaml_text)
require 'net/http'
require 'yaml'
require 'pp'
org_id = '<your org here>'
channel_id = '<desired channel id here>'
yaml_text =
Net::Http.get(URI.parse("http://api.video.limelight.com/rest/organizations/
{org_id}/channels/{channels_id}/media.yaml")
pp YAML::load(yaml_text)
| Description | Get a listing of all channels in an account, count the channels and output the count to the screen. |
|---|---|
| Code Sample | api_auth_example.txt |
$signed_request = LvpAuthUtil::authenticate_request("GET", $request, $access_key, $secret);
include 'LvpAuthUtil.php'; $access_key = "<INSERT_YOUR_ACCESS_KEY>"; $secret = "<INSERT_YOUR_SECRET>"; $org_id = "<INSERT_YOUR_ORG_ID>"; $request = "http://api.video.limelight.com/rest/organizations/$org_id/channels/all.json";
$response = file_get_contents($signed_request);
$channel_array = json_decode($response);
echo("<p>There are " . count($channel_array->channel_list) . " total channels</p>");
| Description |
Upload a new media to an account. Use the
browser to perform the POST and a simple HTML form to gather viewer input. Limitations: Because the browser is performing the upload, the browser will receive the response. If you would like to perform an action based on the response (e.g. do something specific with the returned media ID) you will need to perform the upload from your server. See 9.2.3 for an example of a server upload. |
|---|---|
| Code Sample | upload_example.txt |
<?php
include 'LvpAuthUtil.php';
$access_key = "<INSERT_YOUR_ACCESS_KEY>";
$secret = "<INSERT_YOUR_SECRET>";
$org_id = "<INSERT_YOUR_ORG_ID>";
// Authenticate the upload URL
$add_media_url = "http://api.video.limelight.com/rest/organizations/$org_id/media";
$signed_url = LvpAuthUtil::authenticate_request("POST", $add_media_url, $access_key, $secret);
?>
<!--Execute the signed upload URL when the user submits a new file--> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Upload to Limelight Video Platform</title> </head> <body> Uploading:<br><form action="<?php echo $signed_url; ?>" method="post" enctype="multipart/form-data"> <input name="title" value="title" type="text" /><br> <input name="description" value="description" type="text" /><br> <input name="media_file" type="file" /><br> <input type="submit" /> </form> </body> </html>
| Description | Upload a new media to an account. Execute the upload from the server using curl. |
|---|---|
| Code Sample | upload_example_curl.txt |
<?php
include 'LvpAuthUtil.php';
$access_key = "<INSERT_YOUR_ACCESS_KEY>";
$secret = "<INSERT_YOUR_SECRET>";
$org_id = "<INSERT_YOUR_ORG_ID>";
$file = '@ski.MOV';
$title = 'API Upload';
$description = 'This file was uploaded with the LVP API using PHP and Curl.';
$upload_media_url = "http://api.video.limelight.com/rest/organizations/$org_id/media";
//authenticate the upload URL
$signed_url = LvpAuthUtil::authenticate_request("POST", $upload_media_url, $access_key, $secret);
?>
<?php
//arrange the details of the upload in an array
$post_params = array("title" => $title, "description" => $description, "media_file" => $file);
//perform the POST using CURL, passing in the array of parameters
$upload_response = do_post($signed_url, $post_params);
//display the media ID of the new upload on the screen
$response_obj = json_decode($upload_response);
echo 'Media ID: ' .$response_obj->media_id;
function do_post($url, $params=array()) {
//this function will perform the POST using curl
// get the curl session object
$session = curl_init($url);
// set the POST options.
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// do the POST and then close the session
$response = curl_exec($session);
curl_close($session);
return $response;
}
?>
| Description | Update the title and description of an existing media in an account. |
|---|---|
| Code Sample | api_update_media.txt |
<?php
include 'LvpAuthUtil.php';
$access_key = "<INSERT_YOUR_ACCESS_KEY>";
$secret = "<INSERT_YOUR_SECRET>";
$org_id = "<INSERT_YOUR_ORG_ID>";
$media_id = "<YOUR MEDIA ID>";
$update_media_url = "http://api.video.limelight.com/rest/organizations/$org_id/media/
$media_id/properties";
# authenticate the call to the api
$signed_update_media_url = LvpAuthUtil::authenticate_request("PUT", $update_media_url, $access_key, $secret);
?>
<?php
# update the media title and description
$params = array("title" => "my new title", "description" => "my new description");
$put_response = do_put($signed_update_media_url, $params);
# Execute the PUT
function do_put($url, $params=array()) {
// Get the curl session object
$session = curl_init($url);
// Set the PUT options.
curl_setopt($session, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// Do the PUT and then close the session
$response = curl_exec($session);
curl_close($session);
return $response;
}
?>
| Description | Create a new channel in an account. Once the channel is created, place a media in the channel and set the state of the channel to 'Published'. Get the embed code for the channel and display the corresponding player on the screen. |
|---|---|
| Code Sample | api_add_new_and_update_channel.txt |
<?php
include 'LvpAuthUtil.php';
$access_key = "<INSERT_YOUR_ACCESS_KEY>";
$secret = "<INSERT_YOUR_SECRET>";
$org_id = "<INSERT_YOUR_ORG_ID>";
$add_new_channel_url = "http://api.video.limelight.com/rest/organizations/$org_id/channels";
// obtain a signature for the add new channel URL
$signed_add_channel_url = LvpAuthUtil::authenticate_request("POST", $add_new_channel_url, $access_key, $secret);
?>
// perform the addition of the new channel
$params = array("title" => "My New API Channel")
$add_channel_response = do_post($signed_add_channel_url, $params);
function do_post($url, $params=array()) {
//this function will perform a POST using curl
// get the curl session object
$session = curl_init($url);
// set the POST options.
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// do the POST and then close the session
$response = curl_exec($session);
curl_close($session);
return $response;
}
<?php
$media_id_to_add = "d6fafd2da733467fac0ba2788993fae8";
$add_media_to_channel_url = "http://api.video.limelight.com/rest/organizations/$org_id/channels/
$new_channel_id/media/$media_id_to_add";
# obtain a signature for the add media to channel URL
$signed_add_media_url = LvpAuthUtil::authenticate_request("PUT", $add_media_to_channel_url, $access_key, $secret);
?>
$add_media = do_put($signed_add_media_url);
function do_put($url, $params=array()) {
//this function will perform a PUT using curl
// get the curl session object
$session = curl_init($url);
// set the PUT options.
curl_setopt($session, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// do the PUT and then close the session
$response = curl_exec($session);
curl_close($session);
return $response;
}
<?php
$update_channel_url = "http://api.video.limelight.com/rest/organizations/$org_id/channels/
$new_channel_id/properties";
# obtain a signature for the update channel URL
$signed_update_channel_url = LvpAuthUtil::authenticate_request("PUT", $update_channel_url, $access_key, $secret);
?>
// perform the channel update
$params = array("state" => "Published");
$put_response = do_put($signed_update_channel_url, $params);
function do_put($url, $params=array()) {
//this function will perform a PUT using curl
// get the curl session object
$session = curl_init($url);
// set the PUT options.
curl_setopt($session, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// do the PUT and then close the session
$response = curl_exec($session);
curl_close($session);
return $response;
}
| Description | Add a new custom media property to an account. Assign a value for this new property on a media and output the result as a key/value pair to the screen. |
|---|---|
| Code Sample | api_create_custom_prop_example.txt |
<?php
include 'LvpAuthUtil.php';
$access_key = "<INSERT_YOUR_ACCESS_KEY>";
$secret = "<INSERT_YOUR_SECRET>";
$org_id = "<INSERT_YOUR_ORG_ID>";
$new_prop_name = "<ADD_YOUR_PROP_NAME>";
$media_id = "<ADD_YOUR_MEDIA_ID>";
$new_prop_value = "Yes";
$create_new_property_url = "http://api.video.limelight.com/rest/organizations/$org_id/media/properties/
custom/$new_prop_name";
# obtain a signature for creating the new custom property
$signed_create_new_property_url = LvpAuthUtil::authenticate_request("PUT", $create_new_property_url, $access_key, $secret);
?>
# perform the creation of the new custom property
$params = array("type" => "list", "default_values" => "Yes,No,Maybe");
$put_response = do_put($signed_create_new_property_url, $params);
# Execute the PUT
function do_put($url, $params=array()) {
// Get the curl session object
$session = curl_init($url);
// Set the PUT options.
curl_setopt($session, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// Do the PUT and then close the session
$response = curl_exec($session);
curl_close($session);
return $response;
}
<?php
include 'LvpAuthUtil.php';
$access_key = "<INSERT_YOUR_ACCESS_KEY>";
$secret = "<INSERT_YOUR_SECRET>";
$org_id = "<INSERT_YOUR_ORG_ID>";
$new_prop_name = "<ADD_YOUR_PROP_NAME>";
$media_id = "<ADD_YOUR_MEDIA_ID>";
$new_prop_value = "Yes";
$assign_value_for_cust_prop_for_a_media_url = "http://api.video.limelight.com/rest/organizations/$org_id/media/$media_id/
properties/custom";
# obtain a signature for creating the new custom property
$signed_add_value_property_url = LvpAuthUtil::authenticate_request("PUT", $assign_value_for_cust_prop_for_a_media_url, $access_key, $secret);
?>
# perform the addition of the value to the media
$params = array($new_prop_name => $new_prop_value);
$put_response = do_put($signed_add_value_property_url, $params);
# Execute the PUT
function do_put($url, $params=array()) {
// Get the curl session object
$session = curl_init($url);
// Set the PUT options.
curl_setopt($session, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// Do the PUT and then close the session
$response = curl_exec($session);
curl_close($session);
return $response;
}
<?php $get_name_and_value_of_cust_property_for_a_media_url = "http://api.video.limelight.com/rest/organizations/$org_id/media/$media_id/ properties/custom/$new_prop_name"; ?> <!--Display the name and value of the newly created custom property--> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Show New Custom Property</title> </head> <body> <br><form action="<?php echo $get_name_and_value_of_cust_property_for_a_media_url; ?>" method="get" enctype="multipart/form-data"> <input type="submit" value="Get Name and Value of Your Newly Added Prop"/> </form> </body> </html>
| Description | Perform the upload of a new media to an account. |
|---|---|
| Code Sample | lvp_upload_api_asp_c_sharp_sample.zip |
| Description | Perform the upload of a new media to an account. |
|---|---|
| Code Sample | lvp_upload_api_vb_sample.zip |

<object id='obj1'
classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,5,0,0' height='400' width='500'>
<param name='src'
value='http://assets.delvenetworks.com/upload-widget/current.swf'/>
<param name='AllowScriptAccess' value='always'/>
<param name='flashvars' value='presigned_url=[URL-ENCODED UPLOAD URL]&redirect_to=[URL-ENCODED REDIRECT TARGET]'/>
<embed name='obj2'
pluginspage='http://www.macromedia.com/go/getflashplayer'
AllowScriptAccess='always'
src='http://assets.delvenetworks.com/upload-widget/current.swf'
height='325' width='475' flashvars='presigned_url=[URL-ENCODED UPLOAD URL]&redirect_to=[URL-ENCODED REDIRECT TARGET]'/>
</object>
<script type="text/javascript">
var media;
function delveUploadWidgetCallback(data)
{
media = eval("media = " + unescape(data));
<insert your logic here>
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript">
var media;
var redir_url;
function delveUploadWidgetCallback(data)
{
media = eval("media = " + unescape(data));
document.getElementById('mediaId').innerHTML = media.media_id;
document.getElementById('desc').innerHTML = media.description;
document.getElementById('orgFilename').innerHTML = media.original_filename;
document.getElementById('redirect_b').style.display = "block";
redir_url = "http://www.example.com?mediaId=" + media.media_id;
}
</script>
<body>
<INSERT_YOUR_UPLOAD_WIDGET_CODE_HERE>
<br /><br />
Details of the recently uploaded media: <br /><br />
Media ID = <span id="mediaId"></span>
<br />
Description = <span id="desc"></span>
<br />
Original Filename = <span id ="orgFilename"></span>
<br /><br />
<span id="redirect_b" style="display: none">
<input type="button" onClick="javascript:window.location = redir_url;" value="Press to Redirect with New Media ID as a Query String"/>
</span>
</body>
</html>
| Description | A list of all media in an account can be obtained by simply calling the search API with no parameters. |
|---|---|
| Code Sample | search_for_all_media.txt |
| Description | To get a list of published media we simply need to specify a single <key>:<value> pair (i.e. 'and=state:published') |
|---|---|
| Code Sample | search_for_pub_media.txt |
| Description | Let's say we wanted to list all 'published' media that has a tag of 'football'. To do this we need two <key>:<value> pairs and the 'and' parameter, like this: 'and=state:published;tag:football' |
|---|---|
| Code Sample | search_using_and_criteria.txt |
| Description | Let's say we wanted to list all media that has a tag of 'football' or a tag of 'hockey'. To do this we need two <key>:<value> pairs and the 'or' parameter, like this: 'or=tag:football;tag:hockey' |
|---|---|
| Code Sample | search_using_or_criteria.txt |
| Description | Let's say we wanted to list all media that does not have a tag of 'football'. To do this we need to imply negation. We do this by putting a dash ('-') before the <key>, like this: 'and=-tag:football' |
|---|---|
| Code Sample | search_using_negation.txt |
| Description | Let's say we wanted to list all media that has a tag of 'football' that currently exists in a particular channel (e.g. the channel corresponding to the ID of 'f608e642dc824303b023e6519c15afc6'). To do this we do the following: 'and=tag:football;channel_id:f608e642dc824303b023e6519c15afc6') |
|---|---|
| Code Sample | limit_search_to_a_channel.txt |
| Description | If you want to find media that has a value (any value) populated for a property you simply specify a <key> with no <value>. For example, let's say I want to find all media that was created after a particular date that has a populated description. The parameters for this would look like this: and=created_after:1322852843;description (notice we do not specify a <value> for description) |
|---|---|
| Code Sample | search_for_media_that_has_a_value.txt |
| Description |
Let's say we wanted to get a list of non-errored audio and video files that have a tag of 'football'. We can do this by using both the 'and' & 'or' parameters. SQL for this query would look something like this:
WHERE tag = football AND state != error AND (media_type = audio OR media_type = video)
The equivalent using the search API would look like this (notice we use the dash ('-') before 'state' to imply negation):
and=tag:football;-state:error&or=media_type:audio;media_type:video
|
|---|---|
| Code Sample | search_for_media_with_complex_criteria.txt |
<media-list has_next="false" data_as_of="1308339832" page_id="0" type="array">
<media>
<id>934f1baa4e6049b59568c0715bbc7eeb</id>
<title>Chelsea vs Liverpool</title>
<description>
A game between Chelsea and Liverpool in the British Premier League
</description>
<media_type>Video</media_type>
<original_filename>chelsea-vs</original_filename>
<state>Published</state>
<duration_in_milliseconds>644800</duration_in_milliseconds>
<total_storage_in_bytes>1045502298</total_storage_in_bytes>
<category>Sports<category/>
<ref_id>My Video ID</ref_id>
<thumbnails>
<thumbnail width="120" height="66">
<url>
http://cpc.delvenetworks.com/bUJCvQz5QIMoBlb_CCD5G4/k08bqk5gSbUlWjAcVu8fus/ye8.120x66.jpeg
</url>
</thumbnail>
<thumbnail width="540" height="304">
<url>
http://cpc.delvenetworks.com/bUJCvQz5QIMoBlb_CCD5G4/k08bqk5gSbUlWjAcVu8fus/ye8.540x304.jpeg
</url>
</thumbnail>
</thumbnails>
<tags>
<tag>chelsea</tag>
<tag>english premier league</tag>
<tag>football</tag>
<tag>liverpool</tag>
</tags>
<sched_start_date/>
<sched_end_date/>
<publish_date>1297964805</publish_date>
<update_date>1301809662</update_date>
<create_date>1297902935</create_date>
<custom_property>
</custom_property>
</media>
<media>
<id>6c8e57248a6e4f0fa9a0093d4c61b938</id>
<title>Harry Potter - Halfblood Prince</title>
<description>The sixth movie in the Harry Potter saga</description>
<media_type>Video</media_type>
<original_filename>harrypotterhalfbloodprince-tlr4b_h720p_stereo</original_filename>
<state>Published</state>
<duration_in_milliseconds>144230</duration_in_milliseconds>
<total_storage_in_bytes>760835214</total_storage_in_bytes>
<category>Entertainment</category>
<ref_id/>My Movie ID2<ref_id/>
<thumbnails>
<thumbnail width="120" height="50">
<url>
http://cpc.delvenetworks.com/bUJCvQz5QIMoBlb_CCD5G4/bI5XJIpuTw8qaAJPUxhuTg/cyM.120x50.jpeg
</url>
</thumbnail>
<thumbnail width="540" height="228">
<url>
http://cpc.delvenetworks.com/bUJCvQz5QIMoBlb_CCD5G4/bI5XJIpuTw8qaAJPUxhuTg/cyM.540x228.jpeg
</url>
</thumbnail>
</thumbnails>
<tags>
<tag>halfblood prince</tag>
<tag>harry potter</tag>
<tag>delve networks</tag>
<tag>movie</tag>
</tags>
<sched_start_date/>
<sched_end_date/>
<publish_date>1297294575</publish_date>
<update_date>1302852324</update_date>
<create_date>1297294202</create_date>
<custom_property>
<Embedded_On>Javascript Sample Page</Embedded_On>
</custom_property>
</media>
</media-list>
$response = request_cache($request, $cache_fullpath,$cache_timeout);
$request = 'http://api.video.limelight.com/rest/organizations/7fd6def47cde 4d5694f9b16bfa04c521/media.xml'; $cache_fullpath = '/mydir/ImageMad1'; $cache_timeout = 7200;
function request_cache($url, $dest_file, $timeout) {
if (!file_exists($dest_file) || filemtime($dest_file) < (time()-$timeout)) {
$data = file_get_contents($url);
$tmpf = tempnam('/tmp','YWS');
$fp = fopen($tmpf,"w");
fwrite($fp, $data);
fclose($fp);
rename($tmpf, $dest_file);
} else {
return file_get_contents($dest_file);