Modifies an asset in your library.
Request
Request syntax:
GET /api2/asset/update
Request body parameters:
Pass the following parameters through the msg parameter:
A valid request must identify an asset by including either the id or external_id request parameter. Pass both of these parameters to assign an external ID to the asset.
Request Parameter | Type | Description |
---|---|---|
id Specify either id or external_id. | String | Identifies an asset by its asset ID. This unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab.. |
external_id Specify either id or external_id. | String | Assign an external ID to the asset identified by the id parameter. If the id parameter is omitted, then it identifies an asset by its external ID. If you are assigning an external ID to an asset, please make sure that it is a unique value. If multiple assets are assigned the same external ID, then an arbitrary one will be selected when accessing it via external ID. |
desc | String | Assigns a name to the asset. |
test_player_url | Any | Specify any value to generate a new test player URL. This parameter solely adds a new test player. Expire a test player via the CMS. |
embed_player_url | Any | Specify any value to generate a new embed player URL. |
require_drm | Integer | Determines whether playback requires a signed playback URL. Valid values are: 0: Playback does not require a signed playback URL. 1: Playback requires a signed playback URL. |
require_studio_drm | Integer | Determines whether Studio DRM will be enforced. Valid values are: 0: Disables Studio DRM enforcement. Learn more. 1: Enforces Studio DRM. Once Studio DRM is activated on your account, Studio DRM encryption is automatically applied to all new assets. This parameter does not alter this behavior. |
meta | Dictionary | Adds and/or overwrites an asset's metadata. Specify a key-value pair for each desired field. Duplicate fields will be overwritten. Clear the asset's metadata by specifying an empty dictionary (i.e., {}). |
poster_img | String | Assigns a poster image to the asset. Specify a Base64-encoded string for an image that is smaller than 3MB before encoding. Reset the asset's poster image by setting this parameter to an empty string (i.e., ''). |
autoexpire | String | Defines a timestamp, in milliseconds, after which the asset will be deleted automatically. Set this parameter to 0 to indicate that the asset should not auto-expire. |
Response
Returns the same response as Get Asset(s) by ID.
Sample Request/Response
The following sample request updates an asset whose asset ID is 5915d84829405cb4db1bc3f71c10fc83.
The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.
from uplynk_api2_auth import Call
print(Call('/api2/asset/update',
id='5915d84829405cb4db1bc3f71c10fc83',
test_player_url=1,
desc='New Desc',
meta='{"key1":"value1", "key2":"value2"}',
poster_img='iVBORw0KGgoAAAANSUhEUgAAAikAAAIoCAIAAAAjrezsAALE6ElEQVR42.....'))
{
"asset": {
"orig_filename": null,
"rays": 8,
"require_drm": 0,
"require_studio_drm": 0,
"slices": 22,
"autoexpire": 0,
"created": 1345730768265,
"job_type": "vod",
"libraries": [],
"meta": {"key1":"value1",
"key2":"value2"},
"test_player_url": "https://content.uplynk.com/player5/Hak3zjnPLSW5o0j8GMpzRMsa.html",
"test_players": [
{"desc": "Monitoring Test Player",
"id": "Hak3zjnPLSW5o0j8GMpzRMsa",
"url": "https://content.uplynk.com/player5/Hak3zjnPLSW5o0j8GMpzRMsa.html"},
{"desc": "Affiliate Test Player",
"id": "3fqeYp0yrG5Pk4bDqazn79",
"url": "https://content.uplynk.com/player5/3fqeYp0yrG5Pk4bDqazn79sa.html"}],
"state": "ready",
"duration": 88.88598639455783,
"embed_player_url": "https://content.uplynk.com/player5/2aZeCWBZd0FVXmU95BGKnjea.html",
"external_id": "foux",
"id": "5d84829405cb4db1bc3f71915c10fc83",
"thumb_url": "http://storage.uplynk.com/slices/.../00d4cfbe2c2b46fc92a2c818b9bd1f9b.jpg",
"desc": "New Desc",
"poster_url": 'http://storage.uplynk.com/slices/.../00d4cfbe2c2b46fc92a2c818b9bd1f9b.jpg"
},
"error": 0
}