Skip to content
Hashim Muqtadir edited this page May 7, 2015 · 1 revision

API Reference

TODO: Add these to docstrings and auto-generate in the future TODO: Document responses

For getting started, have a look at the project README instead, which has a friendly list of curl requests and responses.

Usage

Note: "Parameter" refers to either URL query parameters or form data, the API generally accepts them both ways whenever possible. Not doing so would be a bug and fixed sooner or later (sooner if reported).

Generally, to specify an entry ID and a Kaltura instance to use, specify an id parameter of the format kaltura_id:entry_id where kaltura_id is the integer ID of the Kaltura instance defined at /view_configs/.

API endpoints that do not require a media entry ID will still require a kaltura_id parameter. This defaults to 1, but it is recommended that you explicitly specify it.

Alternatively, API call pertaining to particular entries will also accept "entry_id" as a URL query parameter. It will also accept it as a form parameter for POST requests. In this case, a "kaltura_id" may also be used, which will otherwise default to "1". Simply use the id parameter instead.

POST API calls that were made to perform some action (upload file, thumbnail/caption CRUD) will return JSON with a field named "success" to indicate success.

Endpoints

  • /service/upload_file
    Upload any file. (via file post or from URL)
    POST a file with its form parameter named "file". KTS will attempt to autodetect the media type.
    Alternatively, provide a form or URL query parameter named "pullPath" and KTS will communicate with Kaltura to obtain the media at the given URL. Media type can be either autodetected, or indicated as the "mediatype" parameter -- image, video or audio. Defaults to video on failed autodetection.
    Required parameters
    kaltura_id
    medianame
    pullPath OR file (as binary form data)

  • /service/get_media/
    Get metadata for given entry id. Returned as JSON. Also contains thumbnail URL. If "width" and "height" parameters are provided, thumbnail URL will be constructed for specified width and height.
    Required parameters
    id OR (entry_id AND kaltura_id)

  • /service/del_media/
    Delete an entry.
    Required parameters
    id OR (entry_id AND kaltura_id)

  • /service/get_player/
    Get embeddable player for entry.
    Required parameters
    id OR (entry_id AND kaltura_id)

  • /service/get_thumbnail_player/
    Get thumbnail selector player for entry. (Useful for old Kaltura servers).
    Required parameters
    id OR (entry_id AND kaltura_id)

  • /service/thumbnail_list/
    Returns list of thumbnails related to entry as JSON.
    Returns a list of objects containing id, width, height, created_at, default and status per object.
    Required parameters
    id OR (entry_id AND kaltura_id)

  • /service/thumbnail_set_default/
    Set given thumbnail as default for given entry.
    Required parameters
    id OR (entry_id AND kaltura_id)
    thumbnail_id

  • /service/remove_thumbnail/
    Remove given thumbnail.
    Required parameters
    kaltura_id
    thumbnail_id

  • /service/update_thumbnail_file
    Update thumbnail for given entry by file. Provide file as form data for the parameter "file". To set the uploaded file as default as well, provide the parameter "default" as a non-empty string.
    Required parameters
    id OR (entry_id AND kaltura_id)
    file (as binary form data)

  • /service/add_thumbnail_from_url/
    Add a thumbnail for given entry from URL specified as the "url" parameter.
    Required parameters
    id OR (entry_id AND kaltura_id)
    url

  • /service/update_thumbnail_from_player
    Update thumbnail for videos by providing an offset. Also used internally by the thumbnail selector player.
    Given an entry id, and a query parameter "offset" in seconds, sets the thumbnail for the video to the frame at given time (offset).
    Required parameters
    id OR (entry_id AND kaltura_id)
    offset

  • /service/list_captions/
    Returns list of captions related to entry as JSON.
    Returns a list of objects containing id, language, created_at, default, name, format and status.
    Required parameters
    id OR (entry_id AND kaltura_id)

  • /service/add_caption/
    Add caption for given entry by file. Provide file as form data for the parameter "file". To set the uploaded file as default as well, provide the parameter "default" as a non-empty string. KTS will attempt to auto-detect caption format. Also, specify language as the parameter "language", eg. English. May be specified as "auto" to attempt language auto-detection.
    Required parameters
    id OR (entry_id AND kaltura_id)
    file (as binary form data)
    Optional parameters default (defaults to False)
    language (defaults to English, set "auto" to auto-detect)

  • /service/remove_caption/
    Remove given caption.
    Required parameters
    kaltura_id
    caption_id

  • /service/set_caption_as_default/
    Set given caption as default for given entry.
    Required parameters
    id OR (entry_id AND kaltura_id)
    caption_id

  • /service/search_video/ Doesn't do anything meaningful yet.

  • /service/get_excel/ Get an excel file containing details on all the media available to the user/publisher of the given Kaltura.
    Required parameters
    kaltura_id
    Optional parameters
    fields Comma separated list of fields to include in the excel file. Defaults to myKalturaObject.DEFAULT_SEARCH_FIELD_LIST. Must be a subset of this.
    pagesize The pagesize to use when obtaining results from Kaltura. Defaults to the maximum of 500.
    filename Custom filename to use instead of the default.
    types Comma separated list of media types. Must contain any of video, audio and image. Defaults to video,audio.

  • /service/get_mobileplayer_url/
    Misleading; returns the URL to the flavorID 13.
    Required parameters
    id OR (entry_id AND kaltura_id)

Clone this wiki locally