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

Metrics

The Metrics class provides methods to fetch statistics about videos on your account.

Get Account Metrics

Method: GET

Path: /metrics

Description: Get the current statistics for your account
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @events = Sorenson::Services::Metric.all
// authenticate and get an account object $account = S360_Account::login("username", "password"); // YYYY-MM-DD format $start_date= "2009-09-01"; $end_date = "2009-09-30"; // get an asset metrics object $asset_metrics = $account->getAssetMetrics($start_date, $end_date); echo $asset_metrics->playTotal
try { // authenticate over ssl connection Account acct = Account.login("bob", "bob"); //YYYY-MM-DD format AssetMetrics metrics = acct.getAssetMetrics("2009-09-01", "2009-09-30"); Console.WriteLine("Total number of plays: " + metrics.geTotalPlays()); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); //YYYY-MM-DD format acct.getAssetMetrics("2009-09-01", "2009-09-30"); //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Get Total Plays

Method: GET

Path: /metrics/total_plays

Description: Check the total number of plays for your account
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") Sorenson::Services::Metric.total_plays
try { // authenticate over ssl connection Account acct = Account.login("bob", "bob"); long num_plays = acct.getTotalPlays(); // total number of plays for the given account Console.WriteLine("Total number of plays: " + num_plays); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); long num_plays = acct.getTotalPlays(); // total number of plays for the given account ... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }

Get Storage Used

Method: GET

Path: /metrics/storage

Description: Check the storage used for the given date range
Parameter Data Type Sample Value Required Description
start_date datetime No
end_date datetime No
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") Sorenson::Services::Metric.storage_used
// authenticate and get an account object $account = S360_Account::login("username", "password"); $start_date = "2009-09-01"; $end_Date = "2009-09-30"; // returns floatval for storage used for the given date range $usedStorage = $account->getStorageUsed($start_date, $end_date); echo "storage used: " . $usedStorage;
try { // authenticate over ssl connection Account acct = Account.login("bob", "bob"); // Date in a YYYY-MM-DD (year-month-day) format String startDate = "2009-01-25"; String endDate = "2009-10-25"; double storage_per_date = acct.getStorageUsed(startDate, endDate); //total storage used by the account for the given data range Console.WriteLine("Storage used for the given date: " + storage_per_date); //... } catch (Exception ex) { // handle excpetion }
try { // authenticates over ssl connection Account acct = Account.login("user_name", "password"); // Date in a YYYY-MM-DD (year-month-day) format String startDate = "2009-01-25"; String endDate = "2009-10-25"; double storage_per_date = acct.getStorageUsed(startDate, endDate); //total storage used by the account for the given data range //... } catch (ThreeSixtyException e1) { e1.printStackTrace(); }
Get Developer Account
Sorenson Media Home
© 2010 Sorenson Media Inc. All Rights Reserved.