Developers
Welcome Developers! Our Developer site contains sample code (in multiple languages), documentation, tools, and additional resources to help you build Sorenson 360-enabled applications.
Get Developer Account

Assets

The Asset class provides methods to fetch and interact with videos uploaded to your account.

Get Asset List

Method: GET

Path: /assets

Description: Gets a list of videos for your account
Parameter Data Type Sample Value Required Description
offset integer No
quantity integer No
Build & Run Sample Spinner
 
Sorenson::ThreeSixty::Account.login("example@sorensonmedia.com", "sorensonExample") # get number of assets given the specified count starting at the given offset assets = Sorenson::ThreeSixty::Asset.all(0, 2) acct.getAssets(offset, count)
// authenticate and get an account object $account = S360_Account::login("username", "password"); $offset= 0; $numberToGet = 5; // get an array of asset objects $asset_list = $account->getAssets($offset, $numberToGet);
try { // authenticate over ssl connection Account acct = Account.login("bob", "bob"); int offset = 0; int numToRetrieve = 5; List assetList = acct.getAssets(offset, numToRetrieve); // use asset list //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); int offset = 0; int numToRetrieve = 5; ArrayList assetList = acct.getAssets(offset, numToRetrieve); // use asset list ... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Get Asset

Method: GET

Path: /assets/:id

Description: Get a video by id
Parameter Data Type Sample Value Required Description
id Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @asset = Sorenson::Services::Asset.find(Sorenson::Services::Asset.all.first)
// authenticate and get an account object $account = S360_Account::login("username", "password"); $offset = 0; $numToGet = 1; // get first asset $asset_list = $account->getAssets($offset, $numToGet); $asset = $asset_list[0];
try { // authenticate over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Get Preset XML

Method: GET

Path: /assets/:id/preset_xml

Description: Fetch encoding presets (XML)
Parameter Data Type Sample Value Required Description
id Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @asset = Sorenson::Services::Asset.find(Sorenson::Services::Asset.all.first) @asset.preset_xml
// authenticate and get an account object $account = S360_Account::login("username", "password"); $offset = 0; $numToGet = 1; // get first asset $asset_list = $account->getAssets($offset, $numToGet); $asset = $asset_list[0]; // print out the preset xml for the given asset echo $asset->presetXml;
try { // authenticate over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // get the preset xml string String assetPresetXml = theAsset.getPresetXML(); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // get the preset xml string String assetPresetXml = theAsset.getPresetXML(); //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Deactivate Asset

Method: POST

Path: /assets/:id/deactivate

Description: Deactivate a video
Parameter Data Type Sample Value Required Description
id Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @asset = Sorenson::Services::Asset.find(Sorenson::Services::Account.all.first) @asset.deactivate @asset.activate
try { // authenticate over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // deactivate the asset theAsset.deavtivate(); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // deactivate the asset theAsset.deavtivate(); //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Activate Asset

Method: POST

Path: /assets/:id/activate

Description: Activate an video
Parameter Data Type Sample Value Required Description
id Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @asset = Sorenson::Services::Asset.find(Sorenson::Services::Account.all.first) @asset.deactivate @asset.activate
try { // authenticate over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // activate the asset theAsset.avtivate(); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // activate the asset theAsset.avtivate(); //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Delete Asset

Method: DELETE

Path: /assets/:id

Description: Delete an asset
Parameter Data Type Sample Value Required Description
id Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @asset = Sorenson::Services::Asset.find(Asset.all.first) @asset.destroy
try { // authenticate over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // delete the asset theAsset.deleteAsset(); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // delete the asset theAsset.deleteAsset(); //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Update Asset

Method: PUT

Path: /assets/:id

Description: Update asset
Parameter Data Type Sample Value Required Description
id Yes
asset[name] No
asset[password] No
asset[description] No
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @asset = Sorenson::Services::Asset.find(Sorenson::Services::Asset.all.first) @asset.description = "new description" @asset.save
try { // authenticate over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // set the display name for the asset theAsset.setDisplayName("new name"); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // set the name theAsset.setDisplayName("name"); //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Get Asset Embed Codes

Method: GET

Path: /assets/:id/embed_codes

Description: Get all embed codes for a given asset
Parameter Data Type Sample Value Required Description
id Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @asset = Sorenson::Services::Asset.find(Sorenson::Services::Asset.all.first) @asset.embed_codes
// authenticate and get an account object $account = S360_Account::login("username", "password"); $offset = 0; $numToGet = 1; // get first asset $asset_list = $account->getAssets($offset, $numToGet); $asset = $asset_list[0]; // get the default embed code echo $asset->defaultEmbed;
try { // authenticate over ssl connection Account acct = Account.login("user_name", "password"); // get asset given the asset id Asset theAsset = acct.getAsset("assetID"); // get embed codes List embedCodeList = theAsset.getDefaultEmbedCodes(); } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); String assetId = "an_asset_id"; // get asset given the asset id Asset theAsset = acct.getAsset(assetId); // get embed codes ArrayList embedCodeList = theAsset.getDefaultEmbedCodes(); //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Get Asset Count

Method: GET

Path: /assets/count

Description: Get a count of all the assets belonging to the account
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") Sorenson::Services::Asset.count
Get Developer Account
Sorenson Media Home
© 2010 Sorenson Media Inc. All Rights Reserved.