Creates a draft of a video clip by identifying:
- An asset in your library.
- The clip's starting and stopping point.
Convert drafts to video clips from within the Clipping tool.
Request
Request syntax:
POST /clipping_draft
Request body:
Define a draft video clip through the following properties:
Property | Data Type | Description |
---|---|---|
beam Required | String | Identifies the asset in your library from which a draft clip will be created by its asset ID. ClosedWhere can I find an asset ID? 1. Navigate to the CMS library by clicking the Content tab. 2. Select the desired asset. 3. The asset ID corresponding to the asset selected in the previous step is listed under the GUID label. |
duration | Integer | You must specify one of the following properties: duration, stop, or stop_time. Learn more. Determines the relative stopping point for the draft of the video clip. Specify the clip's duration, in seconds, starting from the time defined by either the start or start_time properties. |
start | Integer | You must specify either start or start_time.Learn more. Determines the relative starting point for the draft of the video clip. Specify this starting point as the number of milliseconds from the start of the asset. |
start_time | String | You must specify either start or start_time.Learn more. Determines the starting point for the draft of the video clip. Specify the date and time (UTC) at which the clip will start. Calculate the number of seconds into the asset at which the clip will start by using the asset's creation date as a point of reference. Use the Asset API to find out an asset's creation date. Syntax: YYYY-MM-DDThh:mm:ssZ Example: 2023-01-08T20:31:11Z ClosedLearn more. Calculate the number of seconds from the start of the asset at which the clip will start by subtracting the asset's creation date from start_time. Formula: Starting PointIdentifies the number of seconds from the start of the asset at which the video clip will start. = Asset's Creation Date - Start Time |
stop | Integer | You must specify one of the following properties: duration, stop, or stop_time. Learn more. Determines the relative stopping point for the draft of the video clip. Specify this stopping point as the number of milliseconds from the start of the asset. |
stop_time | String | You must specify one of the following properties: duration, stop, or stop_time. Learn more. Determines the stopping point for the draft of the video clip. Specify the date and time (UTC) at which the clip will stop. Calculate the number of seconds into the asset at which the clip will stop by using the asset's creation date as a point of reference. Use the Asset API to find out an asset's creation date. Syntax: YYYY-MM-DDThh:mm:ssZ Example: 2023-01-08T20:31:11Z ClosedLearn more. Calculate the number of seconds from the start of the asset at which the clip will stop by subtracting the asset's creation date from start_time. Formula: Stopping PointIdentifies the number of seconds from the start of the asset at which the video clip will stop. = Asset's Creation Date - Stop Time |
title | String | Defines a description that will be assigned to the draft of the clip. Default value: By default, the asset's description will be assigned to the draft of the clip. |
meta | Dictionary | Identifies zero or more key-value pairs that will override a profile's metadata configuration for the current draft. You cannot use this property to add or remove metadata keys from a profile. Specifying a key that does not exist within the profile will cause it to be ignored. This property does not override key-value pairs that have not been specified. For example, if you specify 2 metadata key-value pairs and a profile contains 5 metadata keys, then the default values for the other 3 metadata keys will also be applied to the current draft. Syntax: {"Key 1Represents a metadata key. This key will be ignored unless it exists in the current profile.":"Value 1Represents the metadata value that will be assigned to a key.", "Key 2Represents a metadata key. This key will be ignored unless it exists in the current profile.":"Value 2Represents the metadata value that will be assigned to a key.", "Key _n_Represents a metadata key. This key will be ignored unless it exists in the current profile.":"Value _n_Represents the metadata value that will be assigned to a key."} Example: {"Title": "Slam Dunk Compilation", "Sport": "Basketball"} |
profile | String | Assigns a profile to the draft of the video clip. You may assign a different profile to the draft of the video clip when using the Clipping tool. Default value: If a profile has not been assigned to a draft of a video clip, then one will be assigned as indicated below: New Session: Upon loading the Clipping tool, the draft of the video clip will be assigned the first profile listed on the Clipping page. Existing Session: The default profile is determined by the currently selected profile within the Clipping tool. |
Identifying a Video Segment
Define a clip's starting and stopping point by passing any of the following combination of properties:
Starting Point | Stopping Point | Sample Usage |
---|---|---|
start Milliseconds from the start of the asset | stop Milliseconds from the start of the asset | Defines a 10 second clip that starts 2 minutes into an asset: ... 'start': 120000, 'stop': 130000, ... |
start Milliseconds from the start of the asset | duration Seconds from start | Defines a 10 second clip that starts 2 minutes into an asset: ... 'start': 120000, 'duration': 10, ... |
start_time Time (ISO 8601 - seconds; UTC) | stop_time Time (ISO 8601 - seconds; UTC) | Defines a 10 second clip that starts 2 minutes into an asset: ... 'start_time': 2023-01-03T17:52:29Z, 'stop_time': 2023-01-03T17:52:39Z, ... |
start_time Time (ISO 8601 - seconds; UTC) | duration Seconds from start | Defines a 10 second clip that starts 2 minutes into an asset: ... 'start_time': 2023-01-03T17:52:29Z, 'duration': 10, ... |
You must specify one of the above property combinations. Do not specify additional time properties. For example, if you define start and stop, do not include start_time, stop_time, or duration in the request.
Use the following syntax to specify a timestamp (ISO 8601 - seconds; UTC):
Syntax:
YYYY-MM-DDThh:mm:ssZ
Example:
2023-01-08T20:31:11Z
Response
The response for a successful request contains the following properties:
Name | Data Type | Description |
---|---|---|
@id | String | Indicates the relative path to an endpoint that points to the newly created draft. |
@type | String | Returns ClippingDraft. |
id | String | Identifies the draft of the clip by its system-defined ID. |
Sample Request/Response
Call the create_draft_clip module (Python 3) to create a draft of a video clip. This module imports names from the api_auth module.
import json
import requests
from api_auth import APICredentials, APIParams
class CreateDraftClip:
def __init__(self):
self.host = "services.uplynk.com"
def run(self):
"""
Create a draft of a video clip.
"""
self._create_draft()
def _create_draft(self):
url = "{}{}".format(self.host, "/api/v4/clipping_draft")
start_milliseconds = 55000 # how far into the asset should the clip start
stop_seconds = 10 # how long after the start point should the clip stop
payload = {
'beam':'0123456789abcdefghijklmnopqrstuv',
'title':'My Clip',
'start': start_milliseconds,
'duration': stop_seconds,
}
headers = {'Content-Type': 'application/json'}
response = requests.post(
url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
)
print(response.json())
CreateDraftClip().run()
Response:
{
"@id": "/api/v4/clipping_draft/abc0123def456ghi789klmno0123pqrs",
"@type": "ClippingDraft",
"id": "abc0123def456ghi789klmno0123pqrs"
}