Retrieves a draft of a video clip. Identify a draft by its system-defined ID.
Request
Request syntax:
GET /clipping_draft/Draft Clip ID
Use the Get All Draft Clips endpoint to retrieve a list of drafts and their system-defined IDs.
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 returns this draft. |
@type | String | Returns ClippingDraft. |
beam | String | Identifies the system-defined ID for the asset from which the draft was created. |
created | String | Indicates the date and time (UTC) at which the draft was created. Syntax: YYYY-MM-DDThh:mm:ss.ssssssZ Example: 2023-01-08T20:31:11.510000Z |
frame_start_time | Float | Indicates the number of seconds into the asset at which the draft will stop. |
frame_stop_time | Float | Indicates the number of seconds into the asset at which the draft will start. |
id | String | Identifies a draft by its system-defined ID. |
title | String | Indicates the description 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. 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 | Indicates the profile assigned to the draft of the video clip. You may choose a different profile when using the Clipping tool to generate a clip from this draft. |
Sample Request/Response
Call the get_draft_clip module (Python 3) to retrieve a draft. This module imports names from the api_auth module.
import json
import requests
from api_auth import APICredentials, APIParams
class GetDraftClip:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
"""
Get a draft of a video clip.
"""
self._get_draft()
def _get_draft(self):
draft_clip_id = 'abc0123def456ghi789klmno0123pqrs' # Replace with the desired draft clip ID.
url = "{}{}{}".format(self.host, "/api/v4/clipping_draft/", draft_clip_id)
response = requests.get(
url, params=APIParams(APICredentials()).get_params({})
)
print(response.json())
GetDraftClip().run()
Response:
{
"beam": "abc0123def456ghi789klmno0123pqrs",
"created": "2019-12-27T23:20:44.436000Z",
"title": "My Third Draft",
"@type": "ClippingDraft",
"frame_stop_time": 52.478,
"frame_start_time": 44.978,
"@id": "/api/v4/clipping_draft/1238de658a2e4149aa772de8c7d8bdef",
"id": "1238de658a2e4149aa772de8c7d8bdef"
}