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

Categories

The Category class provides methods to group your videos together into categories.

Get Categories

Method: GET

Path: /categories

Description: List the video categories set up on the account
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @category = Sorenson::Services::Category.create('test') @categories = Sorenson::Services::Category.all

Get Root Categories

Method: GET

Path: /categories/roots

Description: List only the root video categories set up on the account
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @parent = Sorenson::Services::Category.create('parent') @child = Sorenson::Services::Category.create('child') @child.parent_id = @parent.id @child.save @categories = Sorenson::Services::Category.all_roots

Get Category by Name

Method: GET

Path: /categories/find_by_name

Description: Get all videos within a single video category (by category name)
Parameter Data Type Sample Value Required Description
name string Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("integrum@integrumtech.com", "integrum", "1234") @category = Sorenson::Services::Category.create('new name') @category = Sorenson::Services::Category.find_by_name('new name')

Get Category by ID

Method: GET

Path: /categories/show/:id

Description: Get all videos within a single video category (by category ID)
Parameter Data Type Sample Value Required Description
id string Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @category = Sorenson::Services::Category.create('test category') @category = Sorenson::Services::Category.find(@category.id)

Create Category

Method: POST

Path: /categories

Description: Create a new video category
Parameter Data Type Sample Value Required Description
category[name] Yes
parent_id No
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @category = Sorenson::Services::Category.create('new')

Edit Category

Method: PUT

Path: /categories/:id

Description: Edit a video asset category by ID
Parameter Data Type Sample Value Required Description
id Yes
category[name] string No
category[parent_name] string No
category[description] string No
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @category = Sorenson::Services::Category.create('a site') @category.description = 'new description'

Delete Category

Method: DELETE

Path: /categories/:id

Description: Delete a video asset category by ID
Parameter Data Type Sample Value Required Description
id string Yes
Build & Run Sample Spinner
 
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234") @category = Sorenson::Services::Category.create(name) @category.destroy

Get Asset Category

Method: GET

Path: /assets/:id/categories

Description: Check which category is associated with an video
Parameter Data Type Sample Value Required Description
id string 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) @category = @asset.add_category('cat_name') @category = @asset.category

Add Category to Asset

Method: POST

Path: /assets/:id/categories

Description: Associate a video with a category
Parameter Data Type Sample Value Required Description
id string Yes
category['name'] string 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) @category = @asset.add_category('a category')

Get Assets Belonging to a Category

Method: GET

Path: /categories/:id/assets

Description: Get videos belonging to a category
Parameter Data Type Sample Value Required Description
id string 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) @category = @asset.add_category('new category') @category = Sorenson::Services::Category.find_by_name('new category') @assets = @category.assets
Get Developer Account
Sorenson Media Home
© 2010 Sorenson Media Inc. All Rights Reserved.