Associate Labels with Asset

You can associate labels with videos, ads, live streams, remote assets, and YouTube videos.

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

Add Single Label to Asset

[PUT]/v2/assets/asset_id/labels/label_id

Add Multiple Labels to Asset

ThePOST method adds labels to the asset, leaving untouched any labels previously added, whereas the PUT method replaces all labels already added to the asset; see the next section.

[POST] /v2/assets/asset_id/labels/[
  "label_id",
  "label_id",
  ...
]

Replace all Labels for an Asset with New Labels

[PUT] /v2/assets/asset_id/labels/[
  "label_id",
  "label_id",
  ...
]

View Labels for an Asset

[GET]/v2/assets/asset_id/labels

Remove Single Label from an Asset

[DELETE]/v2/assets/asset_id/labels/label_id

Remove All Labels from an Asset

[DELETE]/v2/assets/asset_id/labels

Examples

This example associates the QtsjklrewsddROoCi9B2B45drs label with the IzNnllMjphu2XF3_UgPROoCi9B2rtWs asset:

[PUT]/v2/assets/IzNnllMjphu2XF3_UgPROoCi9B2rtWs/labels/QtsjklrewsddROoCi9B2B45drs ?api_key=<your API key>&expires=1930294539&signature=<signature>

Backlot returns a 200 response.

This example associates the 638aed2a18734375b3b332cb85999dd2 and 814efb109416490a98ee3f4fcd6784cf labels with the IzNnllMjphu2XF3_UgPROoCi9B2rtWs asset:

[PUT]/v2/assets/IzNnllMjphu2XF3_UgPROoCi9B2rtWs/labels[  
   "638aed2a18734375b3b332cb85999dd2",
   "814efb109416490a98ee3f4fcd6784cf"
]

Backlot returns a response similar to the following:

{  
   "items":[  
      {  
         "name":"Sports",
         "id":"814efb109416490a98ee3f4fcd6784cf",
         "parent_id":null,
         "full_name":"/Sports"
      },
      {  
         "name":"Riveting",
         "id":"638aed2a18734375b3b332cb85999dd2",
         "parent_id":null,
         "full_name":"/Riveting"
      }
   ]
}
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.

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