Upload videos
A video indexing task represents a request to upload and index a video. The Resources.Task
class provides methods to manage your video indexing tasks.
Methods
Create a video indexing task
Description: This method creates a new video indexing task that uploads and indexes a video.
Function signature and example:
Parameters:
The CreateTaskParams
interface defines the parameters for creating a new video indexing task:
Return value: Returns a Promise
that resolves to a Models.Task
instance representing the newly created video indexing task.
Note
As shown in the example code above, you can use the waitForDone
method of the Models.Task
class to monitor the status of a video indexing task until it completes.
API Reference: For a description of each field in the request and response, see the Create a video indexing task page.
Related guide: Upload single videos.
Retrieve a video indexing task
Description: This method retrieves the details of a specific video indexing task.
Function signature and example:
Parameters
Return value: Returns a Promise
that resolves to a Models.Task
instance.
API Reference: For a description of each field in the response, see the Retrieve a video indexing task.
List video indexing tasks with direct pagination
Description: This method returns a paginated list of the video indexing tasks in your account based on the provided parameters. By default, the platform returns your video indexing tasks sorted by creation date, with the newest at the top of the list. Choose this method mainly when the total number of items is manageable, or you must fetch a single page of results.
Function signature and example:
Parameters:
The ListTaskParams
interface extends the PageOptions
interface and defines the parameters for listing video indexing tasks:
The following properties are inherited from PageOptions
:
Return value: Returns a Promise
that resolves to an array of Models.Task
instances.
API Reference: For a description of each field in the request and response, see the List video indexing tasks page.
Related guides:
List video indexing tasks with iterative pagination
Description: This method returns a paginated list of the video indexing tasks in your account based on the provided parameters. Choose this method mainly when your application must retrieve a large number of items. By default, the platform returns your video indexing tasks sorted by creation date, with the newest at the top of the list.
Function signature and example:
Parameters
The ListTaskParams
interface extends the PageOptions
interface and defines the parameters for listing video indexing tasks:
The following properties are inherited from PageOptions
:
Return value: Returns a Promise
that resolves to a Models.TaskListWithPagination
instance.
Note
To retrieve subsequent pages of results, use the async iterator protocol:
- Invoke the
next
method of theTaskListWithPagination
object. - Repeat this call until the method returns a promise that resolves to
null
, indicating no more pages exist.
API Reference: For a description of each field in the request and response, see the List video indexing tasks page.
Related guides:
Delete a video indexing task
Description: This method deletes an existing video indexing task.
Function signature and example:
Parameters:
Return value: Returns a Promise
that resolves to void
. This method doesn’t return any data upon successful completion.
API Reference: Delete a video indexing task.
Import videos
Description: An import represents the process of uploading and indexing all videos from the specified integration. This method initiates an asynchronous import.
Function signature and example:
Parameters:
Return value: Returns a Models.TransferImportResponse
object containing two lists:
- Videos that will be imported.
- Videos that will not be imported, typically due to unmet prerequisites .
API Reference: Import videos.
Related guide: Cloud-to-cloud integrations.
Retrieve import status
Description: This method retrieves the current status for each video from a specified integration and index.
Function signature and example:
Parameters:
Return value: Returns a Models.TransferImportStatusResponse
object containing lists of videos grouped by status. See the Task object page for details on each status.
API Reference: Retrieve import status.
Related guide: Cloud-to-cloud integrations.
Retrieve import logs
Description: This method returns a chronological list of import operations for the specified integration.
Function signature and example:
Parameters:
Return value: Returns a Models.TransferImportLog
object containing a chronological list of import operations for the specified integration. The list is sorted by creation date, with the oldest imports first. Each item in the list contains:
- The number of videos in each status
- Detailed error information for failed uploads, including filenames and error messages.
API Reference: Retrieve import logs.
Related guide: Cloud-to-cloud integrations.