Labels

When added to external publishing targets, labels specify which videos, channels, and
channel sets to publish externally. Additionally, labels are also useful for organizing your
video library, searching for videos, and retrieving targeted analytics.

Create a Label

[POST]/v2/labels{ 
   properties
} 

Create multiple labels using full label name

The full paths of labels must be CGI-escaped (URL-encoded) and must begin with a leading
slash. All components of the path are created.

Note:

If a label specified in a request already exists, the system returns the identifier
and other information about that pre-existing label. For example, if your request contains
two new labels and two that already exist, the two new labels are created. The identifiers
and other information for all four labels are returned in the response.

If there are multiple labels with the same full path name (for example, two labels with
the exactly same full path name "/a/b/c"), and you try to create a label with the full
path name "/a/b/c/d", the system responds with error 400 because it does not know which
"/a/b/c" to use.

[POST]/v2/labels/by_full_path//full/path/label1,/full/path/label2,...

List Labels

[GET]/v2/labels

List All Top-level Labels

[GET]/v2/labels?is_root=true

Get assets assigned to a label

[GET]/v2/labels/label_id/assets

View Label Information

[GET]/v2/labels/label_id

View All Sub-labels Associated With a Label

[GET]/v2/labels/label_id/children

View Label Information by Full Path Names

The full paths of labels must be CGI-escaped (URL-encoded). The services returns 400 if any
paths do not exist. The response body states which components of the paths already exist or
are
missing.

[GET]/v2/labels/by_full_path//full/path/label1,/full/path/label2

Delete a Label

[DELETE]/v2/labels/label_id

Route Attributes

The following table describes all attributes that can be expressed through the route.

Route Attribute Description
label_id

The ID of the label. To get a list of labels, perform a get against the
/v2/labels route.

Type: String

Default: None

Example: /labels/r28ertfe44ea4e648fd07d4509123254 b

Query String Parameters

The following table describes all parameters that can be expressed through the route.

Parameter Description
is_root

Retreives all top-level labels.

Type: Boolean

Default: If is_root is not specified, default value is false.

Example: /v2/labels?is_root=true

Properties

The following table describes all properties that can be associated with a label.

Property Description Required?
asset_count

Read-only. Specifies the number of assets using the label. Returned when you make
a get request against a specific label ID.

Type: Integer

Example: 42

No
full_name

Full path to the label, including any parents.

Type: String

Example: "/Sports/Motorcycle Racing"

Yes
id

Read only. ID of a label.

Type: String

Example: "814efb109416490a98ee3f4fcd673244"

Yes
items

Array containing labels. Returned by a get request to
/v2/labels.

Type: Array

Example: n/a

No
name

Name of a label. To use non-Latin characters, make sure they are UTF-8 and
URI-encoded.

Type: String

Example: "Motorcycle Racing"

Yes
parent_id

ID of the parent label.

Type: String

Condition: Required when adding a child label to a parent label.

Example: "Sports"

Conditional

Examples

This example creates a top-level label:

[POST]/v2/labels{  
   "name":"Hobbies"
}

Backlot returns a response similar to the following:

{
   "name":"Hobbies",
   "id":"d5751b77a0c24972888bf906734d4522",
   "full_name":"/Hobbies",
   "parent_id":null
}
Note:

Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see
The Scratchpad.

This example adds a child label to a parent label:

[POST]/v2/labels{  
   "name":"Hockey",
   "parent_id":"d5751b77a0c24972888bf906734d4522"
}

Backlot returns a response similar to the following:

{  
   "name":"Hockey",
   "id":"85042f300fc143c093e8f4ee01894355",
   "full_name":"/Hobbies/Hockey",
   "parent_id":"d5751b77a0c24972888bf906734d4522"
}
Note:

Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see
The Scratchpad.

This example creates multiple labels, specified by their full path names, in a
single call.
[POST]/v2/labels/by_full_path//sports/football/NFL,/animal videos/buffaloes
Note:

Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see
The Scratchpad.

This example lists all labels:

[GET]/v2/labels

Backlot returns a response similar to the following:

{  
   "items":[  
      {  
         "name":"Sports",
         "id":"814efb109416490a98ee3f4fcd6784cf",
         "parent_id":null,
         "full_name":"/Sports"
      },
      {  
         "name":"Motorcycle Racing",
         "id":"bace921fdea44cc18a5a273155514522",
         "parent_id":"814efb109416490a98ee3f4fcd673244",
         "full_name":"/Sports/Motorcycle Racing"
      },
      {  
         "name":"Hockey",
         "id":"85042f300fc143c093e8f4ee01894355",
         "parent_id":"d5751b77a0c24972888bf906734d8c34",
         "full_name":"/Hobbies/Hockey"
      },
      {  
         "name":"Hobbies",
         "id":"d5751b77a0c24972888bf906734d4522",
         "parent_id":null,
         "full_name":"/Hobbies"
      }
   ]
}
Note:

Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see
The Scratchpad.

This example deletes a label:

[DELETE]/v2/labels/85042f300fc143c093e8f4ee01894355

Backlot returns a 200 response.

Note:

Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see
The Scratchpad.