Working with Labels

Note: For more information about Backlot REST API commands, see the Backlot API Reference.

After you associate a video, channel, remote asset, or channel set with a label, Backlot automatically publishes it based on how you configured syndication.

Before you can associate them with assets, you must create the labels. See .

To work with labels for an asset:

  1. To associate a label with an asset, use POST with the /v2/assets route, the asset ID, the /v2/labels qualifier, and a label ID. You can also associate multiple labels at the same time. The following example adds the Motorcycle Racing label to the JxbzdkMjqBEsO asset.
    [PUT]/v2/assets/JxbzdkMjqBEsO/labels/bace921fdea44cc18a5a273155514522

    Backlot returns a response similar to the following.

    {  
       "items":[  
          {  
             "name":"Sports",
             "id":"814efb109416490a98ee3f4fcd6784cf",
             "full_name":"/Sports",
             "parent_id":null
          },
          {  
             "name":"Motorcycle Racing",
             "id":"bace921fdea44cc18a5a273155514522",
             "full_name":"/Sports/Motorcycle Racing",
             "parent_id":"814efb109416490a98ee3f4fcd6784cf"
          }
       ]
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

  2. View the current labels for an asset with GET /v2/assets/asset_id/labels. The following example gets the labels for the JxbzdkMjqBEsO asset.
    [GET]/v2/assets/JxbzdkMjqBEsO/labels

    Backlot returns a response similar to the following.

    {  
       "items":[  
          {  
             "name":"Sports",
             "id":"814efb109416490a98ee3f4fcd6784cf",
             "full_name":"/Sports",
             "parent_id":null
          }
       ]
    }
    Note:

    Try out the code samples using your account credentials in the Ooyala Scratchpad. For information about using the Scratchpad, see Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

  3. To remove a single label from an asset, use DELETE with the /v2/assets route, the asset ID, the /labels qualifier, and a label ID. To disassociate all labels from the asset, specify /labels without a label ID.
    Note: To permanently delete a label and remove it from all assets, see Deleting Labels.

    The following example removes the Motorcycle Racing label from the JxbzdkMjqBEsO asset.

    [DELETE]/v2/assets/JxbzdkMjqBEsO/labels/814efb109416490a98ee3f4fcd6784cf

    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 Practice Making Requests with the Scratchpad. To launch the scratchpad, go to Ooyala API Scratchpad.

해당 내용이 도움 되었습니까?