API calls

Activities

The following API allows to list activities.

/api/v2/activities/

mediaserver.api.v2.views.activities.api_list(request)

This url returns the list of polls/questionnaires, 5 items per page.

Request method: GET

Params

[search]
Text to search in title.
[filter-type]
Filter by type. Possible values: polls or questionnaires.
[filter-category]
Filter by category. Example: [1, 3, 6].
[filter-state]

Filter by state. Possible values:

  • deactivated
  • closed
  • upcoming
  • open

Example: [‘open’, ‘upcoming’].

[page]
Page number

Return:

data
polls
List of polls/questionaires.
current_page
The current page.
page_count
Number of pages.

Annotations

The following API allows to annotate media and fetch current annotations; the API refers to annotations as annotations

/api/v2/annotations/list/

mediaserver.api.v2.views.annotations.api_list(request)

This url returns the list of annotations for a media

Request method: GET

Params

oid
media object id
[no_existing_ids]
Not include the annotations ids list. Values ‘yes’ / ‘no’ default ‘no’
[updated_after]
load annotation updated after this date format yyyymmddHHMMSS
[after]
load annotation created after this date format yyyymmddHHMMSS
[before]
load annotation created before this date format yyyymmddHHMMSS (limited to 10 need to be fix)

Return

annotations
list of annotations
types
Linked types on annotations
extra
if you could load more annotations with the same request with the before date
curl -i -X GET "http://sandbox.ubicast.tv/api/v2/annotations/list/?oid=v12516cfb62d0aeii2m4&after=20151102000000"
jQuery example:
$.ajax({
    url: "/api/v2/annotations/list/",
    method: "GET",
    data: {"oid": "v12516cfb62d0aeii2m4", "updated_after": "20151012095507"},
    dataType: "json",
    success: function (response) {
        if (response.success) {
            console.log(response.annotations);
            console.log(response.types);
        } else {
            console.log(response.message);
        }
    }
});
{
    "types": {
        1: {
            "internal_type": "",
            "allow_keywords": false,
            "color": "#c9000f",
            "visibility": true,
            "disabled": false,
            "allow_content": true,
            "allow_attachment": true,
            "id": ,
            "categories": [
                {
                    "enable_mailing": true,
                    "enable_notification": false,
                    "id": 9,
                    "disabled": false,
                    "label": "catest",
                    "slug": "catest"
                },
                {
                    "enable_mailing": false,
                    "enable_notification": false,
                    "id": 13,
                    "disabled": true,
                    "label": "test",
                    "slug": "test"
                }
            ],
            "slug": "question",
            "enable_mailing": true,
            "enable_notification": true,
            "allow_title": false,
            "enable_social": true,
            "label": "Question"
        },
    },
    "annotations": [
        {
            "timeago": "2 days ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Tuesday, November 3rd, 2015, 09:46",
            "poster_id": 1,
            "date": 20151103094657,
            "replies": [],
            "keywords": "",
            "validation_date": 20151103094657,
            "id": 7276,
            "update_date": 20151103094657,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "",
            "content": "email 1<div class="linked-images"></div>",
            "type_id": 1,
            "preview_content": "email 1<div class="linked-images"></div>",
            "time_in_sec": 0,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 00",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-11-03 09:46:57",
            "raw_content": "email 1",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20151103094657,
            "time": 0
        },
        {
            "timeago": "2 days ago",
            "popularity_display": "+1",
            "is_new": 0,
            "date_display": "Tuesday, November 3rd, 2015, 09:48",
            "poster_id": 1,
            "date": 20151103094802,
            "replies": [],
            "keywords": "",
            "validation_date": 20151103094802,
            "id": 7277,
            "update_date": 20151103100015,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "",
            "content": "email 2<div class="linked-images"></div>",
            "type_id": 1,
            "preview_content": "email 2<div class="linked-images"></div>",
            "time_in_sec": 0,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 00",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "",
            "popularity": 1,
            "favorite": false,
            "raw_date": "2015-11-03 09:48:02",
            "raw_content": "email 2",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20151103094802,
            "time": 0
        }
    ],
    "success": true,
    "extra": 0
}

/api/v2/annotations/slides/list/

mediaserver.api.v2.views.annotations.api_list_slides(request)

This url returns the list of slides for a media (slides are a built-in annotation type and are visible in the slides tab)

Request method: GET

Params

oid
media object id

Return

slides
list of slides
curl -i -X GET http://sandbox.ubicast.tv/api/v2/annotations/slides/list/?oid=v12516cfb62d0aeii2m4
jQuery example:
$.ajax({
    url: "/api/v2/annotations/slides/list/",
    method: "GET",
    data: {"oid": "v12516cfb62d0aeii2m4"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.slides);
        else
            console.log(response.message);
    }
});
{
    "slides": [
        {
            "timeago": "5 days, 22 hours ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Friday, October 30th, 2015, 11:32",
            "poster_id": 1,
            "date": 20150616155320,
            "keywords": "15km, lff, wilëx, rffîg, politique, rlcot, qäl, 10jullleë2013s, dricot, lfane, ïüîîieïf2ü1, lionel",
            "validation_date": 20151030113250,
            "id": 3,
            "update_date": 20151030113250,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "New title",
            "content": "wdqferftegf",
            "attachment": {
                "url": "/protected/videos/v12516cfbb0efah5bb1820km6h6klj/images/capture_1373468904_171938.jpg",
                "thumbnail_url": "/protected/videos/v12516cfbb0efah5bb1820km6h6klj/images/previews/capture_1373468904_171938.jpg.jpg",
                "type": "jpg",
                "filename": "capture_1373468904_171938.jpg"
            },
            "type": {
                "internal_type": "slide",
                "allow_keywords": true,
                "color": "#88c35c",
                "visibility": true,
                "disabled": false,
                "allow_content": false,
                "allow_attachment": true,
                "id": 5,
                "slug": "slide",
                "enable_mailing": false,
                "enable_notification": false,
                "allow_title": true,
                "enable_social": false,
                "label": "Slide"
            },
            "preview_content": "wdqferftegf<div class="linked-images"></div>",
            "time_in_sec": 0,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 00",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "New title",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-06-16 15:53:20",
            "raw_content": "wdqferftegf",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20151030113250,
            "time": 0
        },
        {
            "timeago": "1 month, 1 week ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Friday, September 25th, 2015, 11:04",
            "poster_id": 1,
            "date": 20150925110459,
            "keywords": "",
            "validation_date": 20150925110459,
            "id": 3122,
            "update_date": 20150925110459,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "Test synchro",
            "content": "",
            "attachment": {
                "url": "/protected/videos/v12516cfbb0efah5bb1820km6h6klj/images/cat_candle_fail.gif",
                "thumbnail_url": "/protected/videos/v12516cfbb0efah5bb1820km6h6klj/images/previews/cat_candle_fail.gif.jpg",
                "type": "gif",
                "filename": "cat_candle_fail.gif"
            },
            "type": {
                "internal_type": "slide",
                "allow_keywords": true,
                "color": "#88c35c",
                "visibility": true,
                "disabled": false,
                "allow_content": false,
                "allow_attachment": true,
                "id": 5,
                "slug": "slide",
                "enable_mailing": false,
                "enable_notification": false,
                "allow_title": true,
                "enable_social": false,
                "label": "Slide"
            },
            "preview_content": "<div class="linked-images"></div>",
            "time_in_sec": 0,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 00",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "Test synchro",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-09-25 11:04:59",
            "raw_content": "",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20150925110459,
            "time": 0
        }
    ],
    "success": true
}

/api/v2/annotations/resources/list/

mediaserver.api.v2.views.annotations.api_list_resources(request)

This url returns the list of resources for a media (resources are a built-in annotation type visible in the info tab)

Request method: GET

Params

oid
media object id

Return

resources
list of resources
curl -i -X GET http://sandbox.ubicast.tv/api/v2/annotations/resources/list/?oid=v12516cfb62d0aeii2m4
jQuery example:
$.ajax({
    url: "/api/v2/annotations/resources/list/",
    method: "GET",
    data: {"oid": "v12516cfb62d0aeii2m4"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.resources);
        else
            console.log(response.message);
    }
});
{
    "success": true,
    "resources": [
        {
            "timeago": "2 months ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Tuesday, September 1st, 2015, 17:35",
            "poster_id": 1,
            "date": 20150824141642,
            "keywords": "",
            "validation_date": 20150824141642,
            "id": 2552,
            "update_date": 20150901173536,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "",
            "content": "yop",
            "attachment": {
                "url": "/protected/videos/v12516cfbb0efah5bb1820km6h6klj/attachments/cat-candle-fail_3Nb4uym.gif",
                "thumbnail_url": "",
                "type": "gif",
                "filename": "cat-candle-fail_3Nb4uym.gif"
            },
            "type": {
                "internal_type": "attachment",
                "allow_keywords": true,
                "color": "#e9af54",
                "visibility": true,
                "disabled": false,
                "allow_content": true,
                "allow_attachment": true,
                "id": 2,
                "slug": "resource",
                "enable_mailing": false,
                "enable_notification": false,
                "allow_title": true,
                "enable_social": true,
                "label": "Resource"
            },
            "preview_content": "yop<div class="linked-images"></div>",
            "time_in_sec": 0,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 00",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-08-24 14:16:42",
            "raw_content": "yop",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20150901173536,
            "time": 0
        },
        {
            "timeago": "2 months, 1 week ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Thursday, August 27th, 2015, 15:40",
            "poster_id": 1,
            "date": 20150827154019,
            "keywords": "",
            "validation_date": 20150827154019,
            "id": 2559,
            "update_date": 20150827154019,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "",
            "content": "test",
            "attachment": {
                "url": "/protected/videos/v12516cfbb0efah5bb1820km6h6klj/attachments/text.doc",
                "thumbnail_url": "",
                "type": "doc",
                "filename": "text.doc"
            },
            "type": {
                "internal_type": "attachment",
                "allow_keywords": true,
                "color": "#e9af54",
                "visibility": true,
                "disabled": false,
                "allow_content": true,
                "allow_attachment": true,
                "id": 2,
                "slug": "resource",
                "enable_mailing": false,
                "enable_notification": false,
                "allow_title": true,
                "enable_social": true,
                "label": "Resource"
            },
            "preview_content": "test<div class="linked-images"></div>",
            "time_in_sec": 0,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 00",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-08-27 15:40:19",
            "raw_content": "test",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20150827154019,
            "time": 0
        }
    ]
}

/api/v2/annotations/chapters/list/

mediaserver.api.v2.views.annotations.api_list_chapters(request)

This url returns the list of chapters for a media (chapters are a built-in annotation type visible in the timeline tab)

Request method: GET

Params

oid
media object id

Return

chapters
list of chapters
curl -i -X GET http://sandbox.ubicast.tv/api/v2/annotations/chapters/list/?oid=v12516cfb62d0aeii2m4
jQuery example:
$.ajax({
    url: "/api/v2/annotations/chapters/list/",
    method: "GET",
    data: {"oid": "v12516cfb62d0aeii2m4"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.chapters);
        else
            console.log(response.message);
    }
});
{
    "success": true,
    "chapters": [
        {
            "timeago": "2 months, 1 week ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Friday, August 28th, 2015, 10:59",
            "poster_id": 1,
            "date": 20150812161748,
            "keywords": "",
            "validation_date": 20150812161748,
            "id": 1873,
            "update_date": 20150828105940,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "φυσι",
            "content": "",
            "type": {
                "internal_type": "chapter",
                "allow_keywords": true,
                "color": "#5c63c3",
                "visibility": true,
                "disabled": false,
                "allow_content": false,
                "allow_attachment": false,
                "id": 4,
                "slug": "chapter",
                "enable_mailing": false,
                "enable_notification": true,
                "allow_title": true,
                "enable_social": false,
                "label": "Chapter"
            },
            "preview_content": "<div class="linked-images"></div>",
            "time_in_sec": 7,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 07",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "φυσι",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-08-12 16:17:48",
            "raw_content": "",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20150828105940,
            "time": 7000
        },
        {
            "timeago": "1 month, 1 week ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Friday, September 25th, 2015, 10:22",
            "poster_id": 1,
            "date": 20150925102200,
            "keywords": "",
            "validation_date": 20150925102200,
            "id": 3117,
            "update_date": 20150925102200,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "Test synchro",
            "content": "",
            "type": {
                "internal_type": "chapter",
                "allow_keywords": true,
                "color": "#5c63c3",
                "visibility": true,
                "disabled": false,
                "allow_content": false,
                "allow_attachment": false,
                "id": 4,
                "slug": "chapter",
                "enable_mailing": false,
                "enable_notification": true,
                "allow_title": true,
                "enable_social": false,
                "label": "Chapter"
            },
            "preview_content": "<div class="linked-images"></div>",
            "time_in_sec": 8,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 08",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "Test synchro",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-09-25 10:22:00",
            "raw_content": "",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20150925102200,
            "time": 8000
        }
    ]
}

/api/v2/annotations/activities/list/

mediaserver.api.v2.views.annotations.api_list_activities(request)

This url returns the list of activities for a media (activities are a built-in annotation type visible in the timeline tab)

Request method: GET

Params

oid
media object id

Return

activities
list of activities
curl -i -X GET http://sandbox.ubicast.tv/api/v2/annotations/activities/list/?oid=v12516cfb62d0aeii2m4
jQuery example:
$.ajax({
    url: "/api/v2/annotations/activities/list/",
    method: "GET",
    data: {"oid": "v12516cfb62d0aeii2m4"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.activities);
        else
            console.log(response.message);
    }
});
{
    "activities": [
        {
            "timeago": "4 weeks ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Thursday, October 8th, 2015, 09:56",
            "poster_id": 1,
            "date": 20151008095652,
            "keywords": "",
            "validation_date": 20151008095652,
            "id": 4946,
            "update_date": 20151008095652,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "test no options",
            "content": "<iframe data-skippable="true" src="/polls/8/"></iframe>",
            "type": {
                "internal_type": "activity",
                "allow_keywords": false,
                "color": "#af5cc3",
                "visibility": true,
                "disabled": false,
                "allow_content": true,
                "allow_attachment": false,
                "id": 3,
                "slug": "activity",
                "enable_mailing": false,
                "enable_notification": true,
                "allow_title": true,
                "enable_social": true,
                "label": "Activity"
            },
            "preview_content": "<iframe data-skippable="true" src="/polls/8/"></iframe><div class="linked-images"></div>",
            "time_in_sec": 8,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 08",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "test no options",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-10-08 09:56:52",
            "raw_content": "<iframe data-skippable="true" src="/polls/8/"></iframe>",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20151008095652,
            "time": 8000
        },
        {
            "timeago": "4 weeks ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Thursday, October 8th, 2015, 09:57",
            "poster_id": 1,
            "date": 20151008095716,
            "keywords": "",
            "validation_date": 20151008095716,
            "id": 4947,
            "update_date": 20151008095716,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "dwqdwq",
            "content": "<iframe auto-display="true"></iframe>",
            "type": {
                "internal_type": "activity",
                "allow_keywords": false,
                "color": "#af5cc3",
                "visibility": true,
                "disabled": false,
                "allow_content": true,
                "allow_attachment": false,
                "id": 3,
                "slug": "activity",
                "enable_mailing": false,
                "enable_notification": true,
                "allow_title": true,
                "enable_social": true,
                "label": "Activity"
            },
            "preview_content": "<iframe auto-display="true"></iframe><div class="linked-images"></div>",
            "time_in_sec": 10,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 10",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "dwqdwq",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-10-08 09:57:16",
            "raw_content": "<iframe auto-display="true"></iframe>",
            "can": {
                "edit": false,
                "validate": false,
                "del": false
            },
            "last_modification": 20151008095716,
            "time": 10000
        }
    ],
    "success": true
}

/api/v2/annotations/types/list/

mediaserver.api.v2.views.annotations.api_list_types(request)

This url returns the list of annotation types for a media

Request method: GET

Params

oid
media object id

Return

types
list of types
curl -i -X GET http://sandbox.ubicast.tv/api/v2/annotations/types/list/?oid=v12516cfb62d0aeii2m4
jQuery example:
$.ajax({
    url: "/api/v2/annotations/types/list/",
    method: "GET",
    data: {"oid": "v12516cfb62d0aeii2m4"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.types);
        else
            console.log(response.message);
    }
});
{
    "success": true,
    "types": [
        {
            "internal_type": "",
            "allow_keywords": false,
            "color": "#c9000f",
            "visibility": true,
            "disabled": false,
            "allow_content": true,
            "allow_attachment": true,
            "id": 1,
            "categories": [
                {
                    "enable_mailing": true,
                    "enable_notification": false,
                    "id": 9,
                    "disabled": false,
                    "label": "catest",
                    "slug": "catest"
                },
                {
                    "enable_mailing": false,
                    "enable_notification": false,
                    "id": 13,
                    "disabled": true,
                    "label": "test",
                    "slug": "test"
                }
            ],
            "slug": "question",
            "enable_mailing": true,
            "enable_notification": true,
            "allow_title": false,
            "enable_social": true,
            "label": "Question"
        },
        {
            "internal_type": "",
            "allow_keywords": false,
            "color": "#00ff00",
            "visibility": true,
            "disabled": true,
            "allow_content": true,
            "allow_attachment": true,
            "id": 16,
            "slug": "test",
            "enable_mailing": false,
            "enable_notification": false,
            "allow_title": false,
            "enable_social": true,
            "label": "test"
        }
    ]
}

/api/v2/annotations/list/moderate/

mediaserver.api.v2.views.annotations.api_list_moderate_annotation(request)

This url returns the list of annotations that a moderator user account is allowed to moderate (validate or delete)

Request method: GET

Params

limit
number of annotations
date_offset and id_offset (optionals but required together)
This annotation last_modification date and annotation id are combined to get annotations after the last load. date format yyyymmddHHMMSS

Return

annotations
return annotation list
more
if you could load more annotations with the same request with a more recent date
curl -i -X GET "http://sandbox.ubicast.tv/api/v2/annotations/list/moderate/?limit=2"
jQuery example:
$.ajax({
    url: "/api/v2/annotations/list/moderate/",
    method: "GET",
    data: {"limit": "10"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotations);
        else
            console.log(response.message);
    }
});
{
    "annotations": [
        {
            "timeago": "16 hours, 28 minutes ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Wednesday, November 4th, 2015, 17:46",
            "poster_id": 1,
            "date": 20151104174632,
            "replies": [],
            "keywords": "",
            "validation_date": 20151104174632,
            "id": 9041,
            "update_date": 20151104174632,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "",
            "content": "rwa<div class="linked-images"></div>",
            "type": {
                "internal_type": "",
                "allow_keywords": false,
                "color": "#c9000f",
                "visibility": true,
                "disabled": false,
                "allow_content": true,
                "allow_attachment": true,
                "id": 1,
                "categories": [
                    {
                        "enable_mailing": true,
                        "enable_notification": false,
                        "id": 9,
                        "disabled": false,
                        "label": "catest",
                        "slug": "catest"
                    },
                    {
                        "enable_mailing": false,
                        "enable_notification": false,
                        "id": 13,
                        "disabled": true,
                        "label": "test",
                        "slug": "test"
                    }
                ],
                "slug": "question",
                "enable_mailing": true,
                "enable_notification": true,
                "allow_title": false,
                "enable_social": true,
                "label": "Question"
            },
            "preview_content": "rwa<div class="linked-images"></div>",
            "time_in_sec": 0,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 00",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-11-04 17:46:32",
            "raw_content": "rwa",
            "can": {
                "edit": false,
                "validate": true,
                "del": true
            },
            "last_modification": 20151104174632,
            "time": 0
        },
        {
            "timeago": "18 hours, 22 minutes ago",
            "popularity_display": "0",
            "is_new": 0,
            "date_display": "Wednesday, November 4th, 2015, 15:52",
            "poster_id": 1,
            "date": 20151104155204,
            "replies": [],
            "keywords": "",
            "validation_date": 20151104155204,
            "id": 9040,
            "update_date": 20151104172720,
            "validated": true,
            "parent": {
                "oid": "v12516cfb62d0aeii2m4",
                "validated": true,
                "slug": "de-linformatique-a-la-politique",
                "title": "De l'informatique à la politique"
            },
            "title": "",
            "content": "wefwe<div class="linked-images"></div>",
            "type": {
                "internal_type": "",
                "allow_keywords": false,
                "color": "#c9000f",
                "visibility": true,
                "disabled": false,
                "allow_content": true,
                "allow_attachment": true,
                "id": 1,
                "categories": [
                    {
                        "enable_mailing": true,
                        "enable_notification": false,
                        "id": 9,
                        "disabled": false,
                        "label": "catest",
                        "slug": "catest"
                    },
                    {
                        "enable_mailing": false,
                        "enable_notification": false,
                        "id": 13,
                        "disabled": true,
                        "label": "test",
                        "slug": "test"
                    }
                ],
                "slug": "question",
                "enable_mailing": true,
                "enable_notification": true,
                "allow_title": false,
                "enable_social": true,
                "label": "Question"
            },
            "preview_content": "wefwe<div class="linked-images"></div>",
            "time_in_sec": 0,
            "poster": "Stéphane Schoorens",
            "timecode": "0 : 00",
            "truncated_content": "",
            "ip_address": "",
            "preview_title": "",
            "popularity": 0,
            "favorite": false,
            "raw_date": "2015-11-04 15:52:04",
            "raw_content": "wefwe",
            "can": {
                "edit": false,
                "validate": true,
                "del": true
            },
            "last_modification": 20151104155204,
            "time": 0
        }
    ],
    "success": true,
    "more": true
}

/api/v2/annotations/vote/

mediaserver.api.v2.views.annotations.api_vote_for_annotation(request)

Set an annotation as favorite; the most favorited annotation becomes the best response.

Request method: POST

Params

annotation_id
annotation id

Return

annotation
modified annotation
curl --data "annotation_id=1" -X POST http://sandbox.ubicast.tv/api/v2/annotations/vote/
jQuery example:
$.ajax({
    url: "/api/v2/annotations/vote/",
    method: "POST",
    data: {"annotation_id": 1},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotation);
        else
            console.log(response.message);
    }
});
{
    "success": true,
    "annotation": {
        "timeago": "1 hour, 3 minutes ago",
        "popularity_display": "0",
        "is_new": 0,
        "date_display": "Wednesday, November 4th, 2015, 15:52",
        "poster_id": 1,
        "date": 20151104155204,
        "replies": [],
        "keywords": "",
        "validation_date": 20151104155204,
        "id": 9040,
        "update_date": 20151104165558,
        "validated": true,
        "parent": {
            "oid": "v12516cfb62d0aeii2m4",
            "validated": true,
            "slug": "de-linformatique-a-la-politique",
            "title": "De l'informatique à la politique"
        },
        "title": "",
        "content": "wefwe<div class="linked-images"></div>",
        "type": {
            "internal_type": "",
            "allow_keywords": false,
            "color": "#c9000f",
            "visibility": true,
            "disabled": false,
            "allow_content": true,
            "allow_attachment": true,
            "id": 1,
            "categories": [
                {
                    "enable_mailing": true,
                    "enable_notification": false,
                    "id": 9,
                    "disabled": false,
                    "label": "catest",
                    "slug": "catest"
                },
                {
                    "enable_mailing": false,
                    "enable_notification": false,
                    "id": 13,
                    "disabled": true,
                    "label": "test",
                    "slug": "test"
                }
            ],
            "slug": "question",
            "enable_mailing": true,
            "enable_notification": true,
            "allow_title": false,
            "enable_social": true,
            "label": "Question"
        },
        "preview_content": "wefwe<div class="linked-images"></div>",
        "time_in_sec": 0,
        "poster": "Stéphane Schoorens",
        "timecode": "0 : 00",
        "truncated_content": "",
        "ip_address": "",
        "preview_title": "",
        "popularity": 0,
        "favorite": false,
        "raw_date": "2015-11-04 15:52:04",
        "raw_content": "wefwe",
        "can": {
            "edit": false,
            "validate": false,
            "del": false
        },
        "last_modification": 20151104155204,
        "time": 0
    }
}

/api/v2/annotations/post/

mediaserver.api.v2.views.annotations.api_post(request)

Create a new annotation or update an existing annotation in a media. Arguments may vary depending on the actual annotation type.

Request method: POST

Params

oid
media object id
[annotation_id]
if set, modify an existing annotation
time
complete annotation timecode (in milliseconds)
type
annotation type id (e.g. 1)
[poster]
user name which will be shown to all users, expect if you use an api key linked to an account that is not shared in this case the poster will be the user api key owner
[title]
annotation title
[content]
text content
[attachment]
attachment
[category]
annotation category
[keywords]
space-separated keywords list

Return

annotation
added annotation

OR

errors
contains a json list of dicts like this [{title: “This field is required”}, ..]
curl --data "oid=v12516cfb62d0aeii2m4&time=1000&poster=New%20test&title=Yeah&content=Ok&type=1" -X POST "http://sandbox.ubicast.tv/api/v2/annotations/post/"
jQuery example:
$.ajax({
    url: "/api/v2/annotations/post/",
    method: "POST",
    data: {
        "oid": "v12516cfb62d0aeii2m4",
        "annotation_id": 5008,
        "time": 123000,
        "poster": "New test",
        "title": "Yeah",
        "content": "Ok",
        "type": 1
    },
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotation);
        else
            console.log(response.message);
    }
});
{
    "message": "<div>Your annotation has been sumitted.</div>",
    "annotation": {
        "timeago": "0 minutes ago",
        "popularity_display": "0",
        "is_new": 0,
        "date_display": "Thursday, November 5th, 2015, 11:24",
        "poster_id": 3,
        "date": 20151105112456,
        "replies": [],
        "keywords": "",
        "validation_date": 20151105112456,
        "id": 9264,
        "update_date": 20151105112456,
        "validated": true,
        "parent": {
            "oid": "v12516cfb62d0aeii2m4",
            "validated": true,
            "slug": "de-linformatique-a-la-politique",
            "title": "De l'informatique à la politique"
        },
        "title": "",
        "content": "Ok<div class="linked-images"></div>",
        "type": {
            "internal_type": "",
            "allow_keywords": false,
            "color": "#c9000f",
            "visibility": true,
            "disabled": false,
            "allow_content": true,
            "allow_attachment": true,
            "id": 1,
            "categories": [
                {
                    "enable_mailing": true,
                    "enable_notification": false,
                    "id": 9,
                    "disabled": false,
                    "label": "catest",
                    "slug": "catest"
                },
                {
                    "enable_mailing": false,
                    "enable_notification": false,
                    "id": 13,
                    "disabled": true,
                    "label": "test",
                    "slug": "test"
                }
            ],
            "slug": "question",
            "enable_mailing": true,
            "enable_notification": true,
            "allow_title": false,
            "enable_social": true,
            "label": "Question"
        },
        "preview_content": "Ok<div class="linked-images"></div>",
        "time_in_sec": 1,
        "poster": "New test",
        "timecode": "0 : 01",
        "truncated_content": "",
        "ip_address": "",
        "preview_title": "",
        "popularity": 0,
        "favorite": false,
        "raw_date": "2015-11-05 11:24:56.421609",
        "raw_content": "Ok",
        "can": {
            "edit": true,
            "validate": true,
            "del": true
        },
        "last_modification": 20151105112456,
        "time": 1000
    },
    "success": true
}

/api/v2/annotations/validate/

mediaserver.api.v2.views.annotations.api_validate(request)

Approve annotation(s), which will make annotations visible to all users; only annotation types that have the social feature enabled can be moderated by users with appropriate permissions.

Request method: POST

Params

annotation_id
annotation id

OR

annotations_ids
list of annotation id

Return

annotation
unvalidated annotation

OR

annotations
unvalidated annotations list
curl --data "annotation_id=8957" -X POST http://sandbox.ubicast.tv/api/v2/annotations/validate/
jQuery example:
$.ajax({
    url: "/api/v2/annotations/validate/",
    method: "POST",
    data: {"annotation_id": "5002"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotation);
        else
            console.log(response.message);
    }
});

OR

$.ajax({
    url: "/api/v2/annotations/validate/",
    method: "POST",
    data: {"annotations_ids": ["5002", "4993"]},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotations);
        else
            console.log(response.message);
    }
});
{
    "message": "Annotation validated.",
    "annotation": {
        "timeago": "0 minutes ago",
        "popularity_display": "0",
        "is_new": 0,
        "date_display": "Thursday, November 5th, 2015, 10:39",
        "poster_id": 1,
        "date": 20151104153518,
        "replies": [],
        "keywords": "",
        "validation_date": 20151105103909,
        "id": 8957,
        "update_date": 20151105103909,
        "validated": true,
        "parent": {
            "oid": "v1253cb678098vu413li",
            "validated": true,
            "slug": "de-linformatique-a-la-politique_part32",
            "title": "De l'informatique à la politique (trimmed)"
        },
        "title": "",
        "content": "aFSHJ;KLSEGHDRH SR<div class="linked-images"></div>",
        "type": {
            "internal_type": "",
            "allow_keywords": false,
            "color": "#c9000f",
            "visibility": true,
            "disabled": false,
            "allow_content": true,
            "allow_attachment": true,
            "id": 1,
            "categories": [
                {
                    "enable_mailing": true,
                    "enable_notification": false,
                    "id": 9,
                    "disabled": false,
                    "label": "catest",
                    "slug": "catest"
                },
                {
                    "enable_mailing": false,
                    "enable_notification": false,
                    "id": 13,
                    "disabled": true,
                    "label": "test",
                    "slug": "test"
                }
            ],
            "slug": "question",
            "enable_mailing": true,
            "enable_notification": true,
            "allow_title": false,
            "enable_social": true,
            "label": "Question"
        },
        "preview_content": "aFSHJ;KLSEGHDRH SR<div class="linked-images"></div>",
        "time_in_sec": 0,
        "poster": "Stéphane Schoorens",
        "timecode": "0 : 00",
        "truncated_content": "",
        "ip_address": "",
        "preview_title": "",
        "popularity": 0,
        "favorite": false,
        "raw_date": "2015-11-04 15:35:18",
        "raw_content": "aFSHJ;KLSEGHDRH SR",
        "can": {
            "edit": false,
            "validate": true,
            "del": true
        },
        "last_modification": 20151105103909,
        "time": 0,
        "question_id": 8956
    },
    "success": true
}

/api/v2/annotations/unvalidate/

mediaserver.api.v2.views.annotations.api_unvalidate(request)

Disapprove annotation(s), which will make annotations invisible to all users but moderators and the original annotation author; only annotation types that have the social feature enabled can be moderated by users with appropriate permissions.

Request method: POST

Params

annotation_id
annotation id

OR

annotations_ids
list of annotation ids

Return

annotation
unvalidated annotation

OR

annotations
unvalidated annotations list
curl --data "annotation_id=8957" -X POST http://sandbox.ubicast.tv/api/v2/annotations/unvalidate/
jQuery example:
$.ajax({
    url: "/api/v2/annotations/unvalidate/",
    method: "POST",
    data: {"annotation_id": "5002"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotation);
        else
            console.log(response.message);
    }
});

OR

$.ajax({
    url: "/api/v2/annotations/unvalidate/",
    method: "POST",
    data: {"annotations_ids": ["5002", "4993"]},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotations);
        else
            console.log(response.message);
    }
});
{
    "message": "Annotation validated.",
    "annotation": {
        "timeago": "0 minutes ago",
        "popularity_display": "0",
        "is_new": 0,
        "date_display": "Thursday, November 5th, 2015, 10:39",
        "poster_id": 1,
        "date": 20151104153518,
        "replies": [],
        "keywords": "",
        "validation_date": 20151105103909,
        "id": 8957,
        "update_date": 20151105103909,
        "validated": false,
        "parent": {
            "oid": "v1253cb678098vu413li",
            "validated": true,
            "slug": "de-linformatique-a-la-politique_part32",
            "title": "De l'informatique à la politique (trimmed)"
        },
        "title": "",
        "content": "aFSHJ;KLSEGHDRH SR<div class="linked-images"></div>",
        "type": {
            "internal_type": "",
            "allow_keywords": false,
            "color": "#c9000f",
            "visibility": true,
            "disabled": false,
            "allow_content": true,
            "allow_attachment": true,
            "id": 1,
            "categories": [
                {
                    "enable_mailing": true,
                    "enable_notification": false,
                    "id": 9,
                    "disabled": false,
                    "label": "catest",
                    "slug": "catest"
                },
                {
                    "enable_mailing": false,
                    "enable_notification": false,
                    "id": 13,
                    "disabled": true,
                    "label": "test",
                    "slug": "test"
                }
            ],
            "slug": "question",
            "enable_mailing": true,
            "enable_notification": true,
            "allow_title": false,
            "enable_social": true,
            "label": "Question"
        },
        "preview_content": "aFSHJ;KLSEGHDRH SR<div class="linked-images"></div>",
        "time_in_sec": 0,
        "poster": "Stéphane Schoorens",
        "timecode": "0 : 00",
        "truncated_content": "",
        "ip_address": "",
        "preview_title": "",
        "popularity": 0,
        "favorite": false,
        "raw_date": "2015-11-04 15:35:18",
        "raw_content": "aFSHJ;KLSEGHDRH SR",
        "can": {
            "edit": false,
            "validate": true,
            "del": true
        },
        "last_modification": 20151105103909,
        "time": 0,
        "question_id": 8956
    },
    "success": true
}

/api/v2/annotations/delete/

mediaserver.api.v2.views.annotations.api_delete(request)

Delete annotation(s)

Request method: POST

Params

annotation_id
annotation id

OR

annotations_ids
list of annotation id

Return

annotation
unvalidated annotation

OR

annotations
unvalidated annotations list
curl --data "annotation_id=9041" -X POST http://sandbox.ubicast.tv/api/v2/annotations/delete/
jQuery example:
$.ajax({
    url: "/api/v2/annotations/delete/",
    method: "POST",
    data: {"annotation_id": "5002"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotation);
        else
            console.log(response.message);
    }
});

OR

$.ajax({
    url: "/api/v2/annotations/delete/",
    method: "POST",
    data: {"annotations_ids": ["5002", "4993"]},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.annotations);
        else
            console.log(response.message);
    }
});
{
    "message": "The selected annotation has been deleted.",
    "annotation": {
        "id": 9041
    },
    "success": true
}

/api/v2/annotations/delete/all/

mediaserver.api.v2.views.annotations.api_delete_all(request)

Delete all annotations for a media

Request method: POST

Params

oid
media object id
type_id
type id delete all annotations for a given type

Return

message
curl --data"oid=v1253cb678098vu413li" -X POST http://sandbox.ubicast.tv/api/v2/annotations/delete/all/
jQuery example:
$.ajax({
    url: "/api/v2/annotations/delete/all/",
    method: "GET",
    data: {"oid": "v12516cfb62d0aeii2m4"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.message);
        else
            console.log(response.message);
    }
});
{
    "message": "Annotations deleted.",
    "success": true
}

/api/v2/annotations/notification/

mediaserver.api.v2.views.annotations.api_notification(request)

Register to email notifications; only annotation types with the mailing option set will trigger email notifications

Request method: POST

Params

oid
media object id
email
owner email

Return

message

OR

errors

curl --data "oid=v1253cb678098vu413li&email=test@test.test" -X POST http://sandbox.ubicast.tv/api/v2/annotations/notification/
jQuery example:
$.ajax({
    url: "/api/v2/annotations/notification/",
    method: "POST",
    data: {"oid": "v12516cfb62d0aeii2m4", "email": "test@test.test"},
    dataType: "json",
    success: function (response) {
        if (response.success)
            console.log(response.message);
        else
            console.log(response.message);
    }
});
{
    "message": "An email has been sent to confirm your demand.",
    "success": true
}

/api/v2/annotations/transfer/

mediaserver.api.v2.views.annotations.api_transfer(request)

This url allows to transfer all annotations from a media to another one.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
media object id.
destination_oid
new media object id.
[copy]
If you want to keep a copy in the original media. ex copy=1, copy=true, copy=yes or anything if copy parameter is present it will copy.

Response (if success):

success
True

/api/v2/annotations/delete-all-social-public-on-media/

mediaserver.api.v2.views.annotations.api_delete_all_social_public_on_media(request)

This url delete all public social annotations on the media oid arg.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
media object id.

Response (if success):

success
True

Authentication

/api/v2/auth/generate-otl-url/

mediaserver.api.v2.views.auth.generate_otl_url(request)

OTL means One Time Login. This url creates the requested user account if it does not exist and it generates an url to log the user in automatically. The url to log the user in is valid for 4 hours.

Request method: POST

Request args:

[api_key]
See documentation index. Only the master API key can be used.
username
Username of user.
email
Email of user.
[first_name]
First name of user.
[last_name]
Last name of user.
[next]
The page the user should be redirected to after going to the OTL url. The url must be an absolute url and must not include the protocol nor the host. For example: “/menu/”.

Response (if success):

success
True
otl_url
The url to log the user in.
new_account
A boolean indicating if the user account has been created.
user_id
The user id.

Channels

/api/v2/channels/

mediaserver.api.v2.views.channels.api_list(request)

This url returns a list of channels.

Request method: GET

Request args:

[api_key]
See documentation index.
[parent_title]
Parent channel title.
[parent_slug]
Parent channel slug. Ignored if a value is set for “parent_title”.
[parent_oid]
Parent channel object id. Ignored if a value is set for “parent_title” or “parent_slug”.
[order_by]
Sets the returned channels ordering. Prefix the value with “-” to use descending order. Default value is “title”. All channels fields can be used (“title”, “slug”, “description”, “language”, …).

Response (if success):

success
True
channels

List of channels built on the following model:

oid
Object id of channel.
title
Title of channel.
slug
Slug of channel.
language
Language of channel.
thumb
Url of channel thumbnail image.
parent_oid
Object id of parent channel if any.

/api/v2/channels/tree/

mediaserver.api.v2.views.channels.api_tree(request)

This url returns a list of channels (as a tree).

Request method: GET

Request args:

[api_key]
See documentation index.
[parent_oid]
Object id of channel in which the tree begins.
[recursive]
Allowed values: “yes” or “no”, default is “yes”. If not recursive, only the channels in requested channels will be returned.
[order_by]
Sets the returned channels ordering. Prefix the value with “-” to use descending order. Default value is “title”. All channels fields can be used (“title”, “slug”, “description”, “language”, …).

Response (if success):

success
True
channels

List of channels built on the following model:

oid
Object id of channel.
dbid
Db id of channel.
title
Title of channel.
slug
Slug of channel.
language
Language of channel.
thumb
Url of channel thumbnail image.
channels
Sub channels (true or false if not recursive).
personal_channel
Boolean to indicate if the user can have a personal channel. Only present if parent_oid is not given.

/api/v2/channels/path/

mediaserver.api.v2.views.channels.api_path(request)

This url returns the path to access a channel or a media. The first item in the result list have no parents. The last item in the result list is the requested channel or media parent.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
object id of item for which the path will be returned.

Response (if success):

success
True
path

list of channels built on the following model:

oid
object id of channel.
dbid
db id of channel.
title
title of channel.
slug
slug of channel.
language
language of channel.

/api/v2/channels/content/

mediaserver.api.v2.views.channels_content.api_list_content(request)

This url returns the list of all media and sub channels in a channel.

Request method: GET

Request args:

[api_key]
See documentation index.
[parent_title]
Parent channel title.
[parent_slug]
Parent channel slug. Ignored if a value is set for “parent_title”.
[parent_oid]
Parent channel object id. Ignored if a value is set for “parent_title” or “parent_slug”. If no value is set for “parent_title”, “parent_slug” and “parent_oid”, the catalog root will be listed (only channels can be returned in this case).
[content]
Selects the type of content that will be returned. The content argument can contains: “c” for channels, “v” for videos on demand, “l” for live streams, “p” for photos groups.
[order_by]
Sets the returned media ordering. Prefix the value with “-” to use descending order. Default value is “-creation_date” for media and “title” for channels. Possible values: “creation_date”, “add_date”, “title”, “slug”, “comments” or “views”.
[validated]
Possible values: “yes” or “no” if this argument is in request, only validated (published) or non validated media will be returned.
[editable]
Possible values: “yes” or “no” if this argument is in request, only editable or non editable media will be returned.
[speaker]
Possible values: “self” or any value. Use this argument to filter content by speaker. If the value is “self”, only the content for which the user making the request is set as speaker will be returned.
[parent_selection_oid]
Oid of a channel or a media for the parent selection mode. (special case, not intended to be used by tier applications)

Response (if success):

success
True
channels

List of sub channels in requested channel. The list is built on the following model:

oid
Object id of channel.
dbid
Id in database of channel.
title
Title of channel.
slug
Slug of channel.
language
Language of channel.
thumb
Url of channel thumbnail image.
can_edit
Boolean to indicate if the user can edit this channel.
can_delete
Boolean to indicate if the user can delete this channel.
videos

List of videos on demand in requested channel. The list is built on the following model:

oid
Object id of video.
dbid
Id in database of video.
title
Title of video.
slug
Slug of video.
language
Language of video.
thumb
Url of video’s thumbnail image.
add_date
Media add date (date when the media has been added to the catalog).
creation
Media creation date (recording date for videos on demand).
layout
Media layout (can be “composition” for Dynamic Rich Media, “webinar” for video next to JPEG slides or “” for regular video).
duration
Media duration.
unlisted
Boolean to indicate if the media is not listed in the portal (only for editable media).
validated
Boolean to indicate if the media is validated (only for editable media).
short_description
Short description of media.
keywords
Keywords of media.
speaker
Media speaker.
speaker_email
Media speaker email.
company
Media company
company_url
Media company url.
license
Media license.
license_url
Media license url.
views
Number of views (only if allowed).
views_last_month
Number of views last month (only if allowed).
comments
Number of comments.
comments_last_month
Number of comments last month.
origin
Media origin.
can_edit
Boolean to indicate if the user can edit this video.
can_delete
Boolean to indicate if the user can delete this video.
live_streams
List of live streams in requested channel. The list is built like the one for videos except that there is no duration field but a status field which indicates the current status of the live stream (“ongoing”, “planned” or “finished”).
photos_groups
List of photos groups in requested channel. The list is built like the one for videos except that there is no duration field.

/api/v2/channels/get/

mediaserver.api.v2.views.channels_content.api_get(request)

This url returns info for requested channel.

Request method: GET

Request args:

[api_key]
See documentation index.
oid | slug | title
Channel object id or slug or title.
[parent]
The channel parent. Ignored if an object id is given. See documentation index to get information on channels identifiers.
[parents]
DEPRECATED. Channel parent channels. Ignored if an object id or a parent is given. Example: “top channel/sub channel” (channel is then get from “sub channel”).
[path]
Possible values: “yes” or “no”. If not set or set to “no”, the path to access the channel in the catalog will not be returned.
[full]
Possible values: “yes” or “no”. If not set or set to “no”, only some information will be returned. In the other case, all information on the media will be returned.

Response (if success):

success
True
info

The channel information:

oid
Object id of channel.
dbid
Id in database of channel.
title
Title of channel.
slug
Slug of channel.
language
Language of channel.
thumb
Url of channel thumbnail image.
add_date
Channel add date (date when the channel has been added to the catalog).
parent_oid
Object id of parent channel if any.
parent_title
Title of parent channel if any.
parent_slug
Slug of parent channel if any.
parent_language
Language of parent channel if any.
views
Number of views (only if allowed).
views_last_month
Number of views last month (only if allowed).
comments
Number of comments.
comments_last_month
Number of comments last month.
sorting
Default content sorting used in this channel.
display_rss_links
Indicates if RSS links should be displayed.
unlisted
Boolean to indicate if this channel is not listed in the portal (only for editable channels).

Additional field if full or path:

path
List of parents of this channel with following fields: “oid”, “dbid”, “title”, “slug”, “language”. Last item of the list is the media parent.

Additional fields if full:

description
Description of channel.
short_description
Short description of channel.
meta_description
Description of channel for HTML meta tag (no HTML markups).
folder_name
The folder name of the channel public and private content (used to build thumbnail path or url).
can_add_channel
Boolean to indicate if the user can add new sub channels in this channel.
can_add_video
Boolean to indicate if the user can add new videos in this channel.
can_edit
Boolean to indicate if the user if can edit this channel.
can_delete
Boolean to indicate if the user if can delete this channel.
can_see_stats
Boolean to indicate if the user if can see statistics on this channel.
external_ref
The channel external reference value.
external_data
The channel external data.
storage_quota
The channel storage quota in bytes.
storage_used
The channel storage used in bytes.

/api/v2/channels/add/

mediaserver.api.v2.views.channels.api_add(request)

This url can be used to add a new channel. Omitted fields are unchanged.

Request method: POST

Request args:

[api_key]
See documentation index.
title
Channel title.
[slug]
Channel slug.
[sorting]
Channel sorting. Allowed values: “creation_date-desc”, “creation_date-asc”, “add_date-desc”, “add_date-asc”, “title-desc”, “title-asc”, “slug-desc”, “slug-asc”, “views-desc”, “views-asc”.
[language]
Channel language.
[parent]
The channel parent. The new channel will be added to root if no parent is set. See documentation index to get information on channels identifiers.
[parent_slug or parent_oid]
DEPRECATED. Parent channel slug or parent channel object id else no parent.

Response (if success):

success
True
oid
The new channel object id.
slug
The new channel slug.

/api/v2/channels/edit/

mediaserver.api.v2.views.channels.api_edit(request)

This url can be used to edit an existing channel. Omitted fields are unchanged.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The channel object id.

Base fields (only requires edition permission on channel):

[title]
The channel title.
[sorting]
The channel sorting. Allowed values: “creation_date-desc”, “creation_date-asc”, “add_date-desc”, “add_date-asc”, “title-desc”, “title-asc”, “comments-desc”, “comments-asc”, “views-desc”, “views-asc”.
[language]
The channel language.
[thumb]
The channel thumbnail image (a file is expected).
[thumb_oid]
An object id of a video on demand. Use the same thumbnail for the channel as the one used by the video.
[thumb_remove]
Delete current channel thumbnail image.

Publishing fields (requires edition permission on channel and edition permission of publishing settings):

[slug]
The channel slug.
[parent]
Parent channel object id. Use an empty value “” to make the channel a top channel (no parent).

Advanced fields (requires edition permission on channel and edition permission of advanced settings):

[display_rss_links]
Display RSS links (“yes”, “no”).
[display_viewers]
Display viewers count (“yes”, “no”).
[storage_quota]
Storage usage limit in GB (integer expected) for all media in this channel. 0 means no limit.
[external_ref]
External reference.
[external_data]
External data.

Response (if success):

success
True

/api/v2/channels/personal/

mediaserver.api.v2.views.channels.api_personal(request)

This url returns the object id of the users’s personal channel if he can have one else a 403 will be given. The personal channel will be created if it was not already created. If no user is specified, the user making the request will be used.

Request method: GET

Request args:

[api_key]
See documentation index.
[create]
Specify if the personal channel should be created if it does not exist. Possible values: “yes” (default) or “no”.
[id]
Specify the personal channel owner’s user id.
[email]
Specify the personal channel owner’s user email. This is ignored if a user id is given.

Response (if success):

success
True
allowed
Indicates if the user is allowed to have a personal channel
[oid]
Object id of channel (if the channel exists or has been created).
[dbid]
Database id of channel (if the channel exists or has been created).
[title]
Title of channel (if the channel exists or has been created).
[slug]
Slug of channel (if the channel exists or has been created).

/api/v2/channels/delete/

mediaserver.api.v2.views.channels.api_delete(request)

This url can be used to delete a channel.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The channel object id.
[delete_content]
Delete all content of requested channel. If content is not deleted, it will be moved to default channel. Possible values: “yes”, “no” (default is “no”).
[delete_resources]
Not applicable if delete_content is set to “no”. Delete all media resources in hosting service (only applicable to videos on demand). Possible values: “yes”, “no” (default is “no”).
[unvalidate_content]
Not applicable if delete_content is set to “yes”. Set all moved content of deleted channel as non published. Possible values: “yes”, “no” (default is “no”).

Response (if success):

success
True
message
The deletion result message.

Default settings

/api/v2/settings/defaults/publishing/

mediaserver.api.v2.views.default_settings.show_publishing(request)

Show publishing default settings globally or for a specific channel.

Request method: GET

Request args:

[channel_oid]
Channel object id.

Response (if success):

success
True
**fields
List of fields: ‘channel_unlisted’, ‘channel_accessible’, ‘video_autovalidate’, ‘video_set_publish_on_move, ‘video_unlisted’, ‘video_accessible’, ‘live_autovalidate’, ‘live_set_publish_on_move, ‘live_unlisted’, ‘live_accessible’, ‘live_max_viewers’, ‘pgroup_autovalidate’, ‘pgroup_set_publish_on_move, ‘pgroup_unlisted’, ‘pgroup_accessible’, ‘lti_allowed’, ‘creation_emails’, ‘annotations_emails’, ‘storage_warning’, ‘managers_emails’.

/api/v2/settings/defaults/community/

mediaserver.api.v2.views.default_settings.show_community(request)

Show community default settings globally or for a specific channel.

Request method: GET

Request args:

[channel_oid]
Channel object id.

Response (if success):

success
True
**fields
List of fields: ‘display_sharing’, ‘display_permalinks’, ‘display_social_links’, ‘display_embeds’, ‘display_downloads’, ‘display_channel_videos’, ‘display_channel’, ‘display_rss_links’, ‘display_viewers’, ‘allow_comments’, ‘allow_anonymous_actions’, ‘allow_anonymous_votes’, ‘moderation_enabled’.

/api/v2/settings/defaults/metadata/

mediaserver.api.v2.views.default_settings.show_metadata(request)

Show metadata default settings globally or for a specific channel.

Request method: GET

Request args:

[channel_oid]
Channel object id.

Response (if success):

success
True
**fields
List of fields: ‘speaker’, ‘speaker_email’, ‘speaker_id’, ‘company’, ‘company_url’, ‘license’, ‘license_url’, ‘language’, ‘categories’, ‘location’, ‘text_before_live’, ‘text_after_live’.

/api/v2/settings/defaults/publishing/apply/

mediaserver.api.v2.views.default_settings.propagate_publishing(request)

Propagate a publishing default settings to his channels and media.

Request method: POST

Request args:

[channel_oid]
Channel object id.
[fields]
Comma-separated list of defaults settings to propagate. List of fields: ‘channel_unlisted’, ‘channel_accessible’, ‘video_autovalidate’, ‘video_set_publish_on_move’, ‘video_unlisted’, ‘video_accessible’, ‘live_autovalidate’, ‘live_set_publish_on_move’, ‘live_unlisted’, ‘live_accessible’, ‘live_max_viewers’, ‘pgroup_autovalidate’, ‘pgroup_set_publish_on_move’, ‘pgroup_unlisted’, ‘pgroup_accessible’, ‘lti_allowed’, ‘creation_emails’, ‘annotations_emails’, ‘storage_warning’, ‘managers_emails’. When changing “X_accessible” fields, no permissions will be changed on sub content.

/api/v2/settings/defaults/community/apply/

mediaserver.api.v2.views.default_settings.propagate_community(request)

Propagate a community default settings to his channels and media.

Request method: POST

Request args:

[channel_oid]
Channel object id.
[fields]
Comma-separated list of defaults settings to propagate. List of fields: ‘display_sharing’, ‘display_permalinks’, ‘display_social_links’, ‘display_embeds’, ‘display_downloads’, ‘display_channel_videos’, ‘display_channel’, ‘display_rss_links’, ‘display_viewers’, ‘allow_comments’, ‘allow_anonymous_actions’, ‘allow_anonymous_votes’, ‘moderation_enabled’.

/api/v2/settings/defaults/metadata/apply/

mediaserver.api.v2.views.default_settings.propagate_metadata(request)

Propagate a metadata default settings to his channels and media.

Request method: POST

Request args:

[channel_oid]
Channel object id.
[fields]
Comma-separated list of defaults settings to propagate. List of fields: ‘speaker’, ‘speaker_email’, ‘speaker_id’, ‘company’, ‘company_url’, ‘license’, ‘license_url’, ‘language’, ‘categories’, ‘location’, ‘text_before_live’, ‘text_after_live’.

/api/v2/settings/defaults/publishing/edit/

mediaserver.api.v2.views.default_settings.edit_publishing(request)

Edit publishing default settings globally or for a specific channel.

Request method: POST

Request args:

[channel_oid]
Channel object id.
[**fields]
Key(s) with value(s) of settings to change. List of fields: ‘channel_unlisted’, ‘channel_accessible’, ‘video_autovalidate’, ‘video_set_publish_on_move’, ‘video_unlisted’, ‘video_accessible’, ‘live_autovalidate’, ‘live_set_publish_on_move’, ‘live_unlisted’, ‘live_accessible’, ‘live_max_viewers’, ‘pgroup_autovalidate’, ‘pgroup_set_publish_on_move’, ‘pgroup_unlisted’, ‘pgroup_accessible’, ‘lti_allowed’, ‘creation_emails’, ‘annotations_emails’, ‘storage_warning’, ‘managers_emails’. The “X_unlisted” and “X_accessible” fields values can be: “” (default), “c” (copy parent value), “y” (yes) or “n” (no). The “X_autovalidate” fields values can be: “” (default), “True” (yes) or “False” (no).

/api/v2/settings/defaults/community/edit/

mediaserver.api.v2.views.default_settings.edit_community(request)

Edit community default settings globally or for a specific channel.

Request method: POST

Request args:

[channel_oid]
Channel object id.
[**fields]
Key(s) with value(s) of settings to change. List of fields: ‘display_sharing’, ‘display_permalinks’, ‘display_social_links’, ‘display_embeds’, ‘display_downloads’, ‘display_channel_videos’, ‘display_channel’, ‘display_rss_links’, ‘display_viewers’, ‘allow_comments’, ‘allow_anonymous_actions’, ‘allow_anonymous_votes’, ‘moderation_enabled’. All fields values can be: “” (default), “True” (yes) or “False” (no).

/api/v2/settings/defaults/metadata/edit/

mediaserver.api.v2.views.default_settings.edit_metadata(request)

Edit metadata default settings globally or for a specific channel.

Request method: POST

Request args:

[channel_oid]
Channel object id.
[**fields]
Key(s) with value(s) of settings to change. List of fields: ‘speaker’, ‘speaker_email’, ‘speaker_id’, ‘company’, ‘company_url’, ‘license’, ‘license_url’, ‘language’, ‘categories’, ‘location’, ‘text_before_live’, ‘text_after_live’. To reset a field value to default, send any value in “<field>_null”, for example: “license_null=yes”. This does not work for the “language” field. To reset the “language” field, send “language=None”.

Downloads

/api/v2/download/

mediaserver.api.v2.views.downloads.api_download_file(request)

This url returns a temporary link to a resource file (if secure link feature is enabled which is the case by default, if so the link is valid for 4 hours by default). A forbidden error (code 403) will be returned if the media resources are not allowed to be downloaded.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
Media object id.
url
The media resource url.
redirect
Redirect to the resulting url. “yes” or “no”, default is “yes”.
[usage]
A word to tag the request to allow tracing in server logs.

Response (if success):

success
True
url
The url to the resource.

/api/v2/download/slides/

mediaserver.api.v2.views.downloads.api_download_slides(request)

This url returns a link to a zip file containing all slides images. The returned link is protected and the user must be logged in or use an API key to access it.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
Media object id.
redirect
Redirect to the resulting url. “yes” or “no”, default is “yes”.

Response (if success):

success
True
url
The url to the zip file.

/api/v2/download/photos/

mediaserver.api.v2.views.downloads.api_download_photos(request)

This url returns a link to a zip file containing all photos images. The returned link is protected and the user must be logged in or use an API key to access it.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
Media object id.
redirect
Redirect to the resulting url. “yes” or “no”, default is “yes”.

Response (if success):

success
True
url
The url to the zip file.

Groups

/api/v2/groups/

mediaserver.api.v2.views.groups.groups_list(request)

This url returns a list of groups. Requires the “can_change_users” permission or the “can_use_permissions_tab” permission.

Request method: GET

Request args:

[api_key]
See documentation index.
[offset]
Start the result list at a given index, similar to SQL offset. Default: 0.
[limit]
Maximum number of results returned. Default: 50. Use 0 to remove limit (the request can be very long and the offset will be ignored).
[order_by]
Order the result list by the given field.
[search]
Search in the result list.
[search_in]
Specify the fields used to do the search.
[search_exact]
Match only fields with the exact value.
[members]
Show group members.

Response (if success):

success
True
groups

List of objects with the following fields:

id
Group id
name
Group name
ref
Group ref
perms_ignore_auth_grps
Boolean indicating if users in this group should ignore authentication groups permissions

/api/v2/groups/get/

mediaserver.api.v2.views.groups.groups_get(request)

This url returns information about a group. Requires the “can_change_users” permission or the “can_use_permissions_tab” permission.

Request method: GET

Request args:

[api_key]
See documentation index.
id|name
Id or name of group.
[members]
Show group members.

Response (if success):

success
True
group

Object with the following fields:

id
Group id
name
Group name
ref
Group ref
perms_ignore_auth_grps
Boolean indicating if users in this group should ignore authentication groups permissions

/api/v2/groups/add/

mediaserver.api.v2.views.groups.groups_add(request)

This url allows to add group. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
name
Group name

Response (if success):

success
True
msg
Message.
id
New group id.

/api/v2/groups/edit/

mediaserver.api.v2.views.groups.groups_edit(request)

This url allows to edit a group settings. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
id
Id of group to edit.
name
New name.

Response (if success):

success
True
msg
Message.

/api/v2/groups/delete/

mediaserver.api.v2.views.groups.groups_delete(request)

This url deletes the requested group. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
id|name
Id or name of group.

Response (if success):

success
True

/api/v2/groups/members/

mediaserver.api.v2.views.groups.members_list(request)

This url allows to list members of a group. Requires the “can_change_users” permission.

Request method: GET

Request args:

[api_key]
See documentation index.
id|name
Id or name of group.

Response (if success):

success
True
members

List of group members with following fields:

id
User id
username
User username
email
User email
speaker_id
User speaker id

/api/v2/groups/members/add/

mediaserver.api.v2.views.groups.members_add(request)

This url allows to add a user to a group. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
id|name
Id or name of group.
user_id|user_email
Id or email of user to add in the group.

Response (if success):

success
True

/api/v2/groups/members/remove/

mediaserver.api.v2.views.groups.members_remove(request)

This url allows to remove a user from a group. Requires the “can_change_users” permission.

Request method: POST

Request args:

  • [api_key]
    See documentation index.
  • id|name
    Id or name of group.
  • user_id|user_email
    Id or email of user to remove from the group.

Response (if success):

  • success
    True

Home page widgets

The following API allows to manage home page widgets.

/api/v2/home/widgets/

mediaserver.api.v2.views.home.list_widgets(request)

This url allows to get the list of existing home page widgets. If the requester has the permission to change site settings (“can_change_settings”), The list of allowed new widgets will be returned.

Request method: GET

Request args:

[api_key]
See documentation index.
[edit_mode]
If set to “yes” and if the requester has the permission to change site settings (“can_change_settings”), the list of allowed new widgets will be returned.

Response (if success):

success
True
widgets
The list of widgets.
has_hidden_widgets
Boolean that indicates if some widgets are not visible for the requester.
allowed_new_widgets
If in edition mode, the list of allowed new widgets.

/api/v2/home/widgets/add/

mediaserver.api.v2.views.home.add_widget(request)

This url allows to add an home page widget. This url requires the permission to change site settings (“can_change_settings”).

Request method: POST

Request args:

[api_key]
See documentation index.
class
The widget class. Some classes are limited to one widget. Allowed classes: “TitleCatalogWidget”, “ChannelListCatalogWidget”, “ChannelCarouselCatalogWidget”, “ElementCatalogWidget”, “PictureCatalogWidget”, “CustomCatalogWidget”, “VideoListCatalogWidget”, “RssCatalogWidget”, “KeywordsCatalogWidget”, “LiveCatalogWidget”.
[redirect]
If present, the response will be a redirection.

Response (if success):

success
True
id
The new widget id.

/api/v2/home/widgets/edit/

mediaserver.api.v2.views.home.edit_widget(request)

This url allows to modify an existing home page widget. This url requires the permission to change site settings (“can_change_settings”).

Request method: POST

Request args:

[api_key]
See documentation index.
[browser_post]
If present, the data will be parsed like it was posted by a browser (missing fields are not ignored and boolean values are set to “true” if any data is sent). The response will be a redirection if enabled.
[prefixed]
If present, all widget data must be prefixed with “<widget class>_<widget id>-“.
class
The widget class. Allowed classes: “TitleCatalogWidget”, “ChannelListCatalogWidget”, “ChannelCarouselCatalogWidget”, “ElementCatalogWidget”, “PictureCatalogWidget”, “CustomCatalogWidget”, “VideoListCatalogWidget”, “RssCatalogWidget”, “KeywordsCatalogWidget”, “LiveCatalogWidget”.
id
The widget id.
transparent
The widget transparent value. Type: boolean. Possible values: “yes” or “no”.
no_header
The widget no_header value. Type: boolean. Possible values: “yes” or “no”.
title
The widget title value.
visible_for
The widget visible_for value. Possible values: “” (all users) or “False” (non authenticated users only), “True” (authenticated users only).
language
The widget language value. Possible values: any language 2 letters code enabled in MediaServer (by default “en” or “fr”).

Specific fields depending on widget class:

TitleCatalogWidget:

link
Link to open when title is clicked.
new_tab
Open line in a new tab.

ChannelCarouselCatalogWidget:

box_bg
Box background color. Example: “#ff0000”;
border_color
Box border color. Example: “#ff0000”;

ElementCatalogWidget:

object_id
Item object id.
show_live
Show active live streams instead of item if any. Type: boolean. Possible values: “yes” or “no”.
big_thumb
Use the best quality image. Type: boolean. Possible values: “yes” or “no”.
thumb_pos
Thumbnail position. Possible values: “” (Right) or “False” (Left), “True” (centered).
show_information
Display item information such as speaker for media, number of views, … Type: boolean. Possible values: “yes” or “no”.
show_description
Display item short description. Type: boolean. Possible values: “yes” or “no”.

PictureCatalogWidget:

src
Image source URL.
alt
Image alternate text.
link
Link to open when title or image is clicked.
new_tab
Open line in a new tab.

CustomCatalogWidget:

html
Custom HTML code.

VideoListCatalogWidget:

show_la
Show the latest videos inside. Type: boolean. Possible values: “yes” or “no”.
show_mv_at
Show the most viewed videos all time inside. Type: boolean. Possible values: “yes” or “no”.
show_mv_lm
Show the most viewed videos last month inside. Type: boolean. Possible values: “yes” or “no”.
show_mc_at
Show the most commented videos all time inside. Type: boolean. Possible values: “yes” or “no”.
show_mc_lm
Show the most commented videos last month inside. Type: boolean. Possible values: “yes” or “no”.
show_tc
Show the tag cloud inside. Type: boolean. Possible values: “yes” or “no”.

RssCatalogWidget:

line_breaks
Separate RSS links with line breaks. Type: boolean. Possible values: “yes” or “no”.

Response (if success):

success
True

/api/v2/home/widgets/delete/

mediaserver.api.v2.views.home.delete_widget(request)

This url allows to delete an home page widget. This url requires the permission to change site settings (“can_change_settings”).

Request method: POST

Request args:

[api_key]
See documentation index.
class
The widget class.
id
The widget id.
[redirect]
If present, the response will be a redirection.

Response (if success):

success
True

/api/v2/home/widgets/move/

mediaserver.api.v2.views.home.move_widgets(request)

This url allows to change the position of home page widgets. This url requires the permission to change site settings (“can_change_settings”).

Request method: POST

Request args:

[api_key]
See documentation index.
<widgets references>
The widgets for which the position should be changed. The reference is composed from the class and the id of widgets, for example: “TitleCatalogWidget_1”. The data should be a string built with position settings: “<row>,<col>|<sizex>,<sizey>”.

Response (if success):

success
True

Latest

/api/v2/latest/

mediaserver.api.v2.views.latest.api_latest(request)

This url returns a list of media and channels ordered by add date or creation date. Requests on this url can take some time to process due to permissions checks. This API call is limited to date query in anti chronological order for the moment.

Request method: GET

Request args:

[api_key]
See documentation index.
[count]
Maximum number of items returned. Default value is 10. This number can only be between 1 and 250.
[start]
Period start for query (no items with a date greater than the start date will be returned). Date format: “%Y-%m-%d %H:%M:%S”. Example of value: 2015-01-01 12:00:00.
[end]
Period end for query (no items with a date lower than the end date will be returned). Date format: “%Y-%m-%d %H:%M:%S”. Example of value: 2014-01-01 12:00:00.
[order_by]
Ordering in response. Default value is “add_date”. Possible values: “add_date” or “creation”. Channels will use “add_date” because “add_date” = “creation” for channels.
[validated]
Possible values: “yes” or “no”. If this argument is in request, only validated (published) or non validated media will be returned.
[editable]
Possible values: “yes” or “no”. If this argument is in request, only editable or non editable media will be returned.
[speaker]
Possible values: “self” or any value. Use this argument to filter content by speaker. If the value is “self”, only the content for which the user making the request is set as speaker will be returned.
[content]
Selects the type of content that will be returned. The content argument can contains: “c” for channels, “v” for videos on demand, “l” for live streams, “p” for photos groups.

Response (if success):

success
True
more
Boolean to indicate if more media exists.
max_date
Add date of the last media of the list.
items

List(s) of channels and media built on the following model:

oid
Object id of item.
dbid
Id in database of item.
title
Title of item.
slug
Slug of item.
language
Language of item.
type
Type of the object: “c”, “v”, “l” or “p”.
thumb
Url of item thumbnail image.
parent_oid
Object id of parent channel.
parent_title
Title of parent channel.
add_date
Item add date (date when the item has been added to the catalog).
[creation]
Media creation date (recording date for videos on demand).
[layout]
Media layout (not present for channels, can be “composition” for Dynamic Rich Media, “webinar” for video next to JPEG slides or “” for regular video).
[duration]
Media duration (for videos on demand).
unlisted
Boolean to indicate if the item is not listed in the portal (only for editable media).
validated
Boolean to indicate if the item is validated (only for editable media).
short_description
Short description of media.
keywords
Keywords of media.
speaker
Media speaker.
speaker_email
Media speaker email.
company
Media company.
company_url
Media company url.
license
Media license.
license_url
Media license url.
origin
Media origin.

Live streams

/api/v2/lives/

mediaserver.api.v2.views.lives.api_list(request)

This url returns the list of all live streams.

Request method: GET

Request args:

Response (if success):

success
True
lives

List of live streams with following fields:

dbid
Live stream id in database.
oid
Live stream object id.
title
Live stream title.
slug
Live stream slug.
thumb
Live stream thumbnail image url.
channel
Live stream channel title.
channel_oid
Live stream channel object id.
status
Live stream status.

/api/v2/lives/statuses/

mediaserver.api.v2.views.lives.api_statuses(request)

This url returns the statuses of all editable live streams.

Request method: GET

Request args:

Response (if success):

success
True
lives

Object containing all live streams statuses using their object id as key. Each live stream has following fields:

viewers
Live stream viewers count.
start
Live stream last session start date.
status
Live stream status. Possible values: planned, ongoing, finished.
status_display
Live stream translated status.

/api/v2/lives/properties/

mediaserver.api.v2.views.lives.api_properties(request)

This url returns the properties of a live stream.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
Live stream object id.

Response (if success):

success
True
stream_hash
Live stream resource hash.
status
Live stream status. Possible values: planned, ongoing, finished.
slide
Live stream slide url.
layout
Live stream player layout.

/api/v2/lives/get-viewers/

mediaserver.api.v2.views.lives.api_get_viewers(request)

This url returns the number of users watching a live stream.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
Live stream object id.

Response (if success):

success
True
viewers
Number of users watching the live stream.

/api/v2/lives/prepare/

mediaserver.api.v2.views.lives.api_prepare(request)

This url triggers the preparation action of a live stream; the response will contain the parameters required to configure the encoder.

Request method: POST

Request args:

[api_key]
See documentation index.
[oid]
Live stream object id. If the live stream with the given object id does not exist, a new live stream will be created using the title given in “title” field or “Live” if not title is given.
[title]
Live stream title. If no live stream matches the given title, a new live stream will be created. Default is “Live”. Ignored if a valid object id is given.
[channel]
Channel in which the live stream will be added if it is created. Can be the channel title, slug, object id or prefixed with mscid-, mscref-, mscpath-. Defaults to the portal default channel. Ignored if a valid object id is given.
[speaker_email]
The speaker email address. This argument is useful only when “mscspeaker” is used to target a channel.
[speaker_id]
The speaker identifier. This argument is useful only when “mscspeaker” is used to target a channel.
[layout]
Layout of player. Allowed values: “video”, “webinar” or “composition”. “video” is the default value.
[layout_preset]
Live stream player layout preset (a JSON which describes graphical elements placement). Default value is an empty string.
[width]
Width of the video stream.
[height]
Height of the video stream.
[slides_width]
Width of the slides.
[slides_height]
Height of the slides.
[randomize]
Add a random part to the stream url. “yes” or “no” (default is the value defined is global player settings).
[multi_streams]
Indicate if the multi streams is handled by the streamer. “yes” or “no” (default “no”).
[streams]

JSON list of streams information. Example of value:

[
    {
        "width": 1280,
        "height": 720,
        "video_bitrate": 1000000,
        "audio_bitrate": 128000,
        "framerate": 30,
    },
    {
        "width": 640,
        "height": 360,
        "video_bitrate": 500000,
        "audio_bitrate": 96000,
        "framerate": 30,
    }
]

Response (if success):

success
True
oid
Live stream object id.
service
Service used for the live stream.
streams
List of information for each stream (width, height, video_bitrate, audio_bitrate, framerate, publish_uri).

Example response (if success):

{
    "success": true,
    "message": "Live stream prepared.",
    "oid": "l125620a3ea2a4er1uso",
    "service": "rtmp",
    "streams": [
        {
            "width": 1280,
            "height": 720,
            "video_bitrate": 1000000,
            "audio_bitrate": 128000,
            "framerate": 30,
            "publish_uri": "rtmp://streaming.local/live/_definst_?doPublish=test/mediaserver-testserver_c6T4I4I6fxEaKJ7KcUbwR1aO4m3LoB_720"
        },
        {
            "width": 640,
            "height": 360,
            "video_bitrate": 500000,
            "audio_bitrate": 96000,
            "framerate": 30,
            "publish_uri": "rtmp://streaming.local/live/_definst_?doPublish=test/mediaserver-testserver_c6T4I4I6fxEaKJ7KcUbwR1aO4m3LoB_360"
        }
    ]
}

/api/v2/lives/start/

mediaserver.api.v2.views.lives.api_start(request)

This url triggers the start action of a live stream, which will hide the pre-live message, open the player and notify all users that the live stream is active.

Request method: POST

Request args:

[api_key]
See documentation index.
[oid]
Live stream object id. If the live stream with the given object id does not exist, a new live stream will be created using the title given in “title” field or “Live” if not title is given.
[title]
Live stream title. If no live stream matches the given title, a new live stream will be created. Default is “Live”. Ignored if a valid object id is given.
[channel]
Channel in which the live stream will be added if it is created. Can be the channel title, slug, object id or prefixed with mscid-, mscref-, mscpath-. Defaults to the portal default channel. Ignored if a valid object id is given.
[speaker_email]
The speaker email address. This argument is useful only when “mscspeaker” is used to target a channel.
[speaker_id]
The speaker identifier. This argument is useful only when “mscspeaker” is used to target a channel.

Response (if success):

success
True

/api/v2/lives/stop/

mediaserver.api.v2.views.lives.api_stop(request)

This url triggers the stop action of a live stream, which will close the player, display the post-live message to the users and stop notifying all users that the live is active.

Request method: POST

Request args:

[api_key]
See documentation index.
[oid]
Live stream object id. If the live stream with the given object id does not exist, a new live stream will be created using the title given in “title” field or “Live” if not title is given.
[title]
Live stream title. If no live stream matches the given title, a new live stream will be created. Default is “Live”. Ignored if a valid object id is given.
[channel]
Channel in which the live stream will be added if it is created. Can be the channel title, slug, object id or prefixed with mscid-, mscref-, mscpath-. Defaults to the portal default channel. Ignored if a valid object id is given.
[speaker_email]
The speaker email address. This argument is useful only when “mscspeaker” is used to target a channel.
[speaker_id]
The speaker identifier. This argument is useful only when “mscspeaker” is used to target a channel.

Response (if success):

success
True

/api/v2/lives/change-slide/

mediaserver.api.v2.views.lives.api_change_slide(request)

This url allows to change the current slide of a live stream.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
Live stream object id.
image
The new slide as an image.

Response (if success):

success
True

/api/v2/lives/change-status/

mediaserver.api.v2.views.lives.api_change_status(request)

This url allows to change the status of a live stream without triggering resources update.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
Live stream object id.
status
New live stream status. Possible values: planned, ongoing, finished.

Response (if success):

success
True

Media

/api/v2/medias/get/

mediaserver.api.v2.views.media.api_get(request)

This url returns info for the requested media.

Request method: GET

Request args:

[api_key]
See documentation index.
oid | slug | title
Media object id or slug or title.
[parents]
Media parent channels. Ignored if an object id is given. Example: “top channel/sub channel” (media is then get from “sub channel”).
[path]
Possible values: “yes” or “no”. If not set or set to “no”, the path to access the media in the catalog will not be returned.
[full]
Possible values: “yes” or “no”. If not set or set to “no”, only some information will be returned. In the other case, all information on the media will be returned.

Response (if success):

success
True
info

The information about the media:

oid
Object id of the media.
title
Title of the media.
slug
Slug of the media.
thumb
Url of the media thumbnail image.
add_date
Media add date (date when the media has been added to the catalog).
creation
Media creation date (recording date for videos on demand).
layout
Media layout (can be “composition” for Dynamic Rich Media, “webinar” for video next to JPEG slides or “” for regular video).
speaker
Media speaker.
speaker_email
Media speaker email.
[duration]
Media duration (only applicable to videos on demand).
parent_oid
Object id of the media parent channel.
parent_title
Title of the media parent channel.
parent_slug
Slug of the media parent channel.

Additional field if full or path:

path
List of parent channels of this media with following fields: “oid”, “dbid”, “title”, “slug”, “language”. Last item of the list is the media parent.

Additional fields if full:

unlisted
True if not listed in the portal.
validated
True if validated (published).
description
Description of the media.
short_description
Short description of the media.
meta_description
Description of the media for HTML meta tag (no HTML markups).
keywords
Keywords of the media.
speaker_id
Media speaker id.
company
Media company.
company_url
Media company url.
license
Media license.
license_url
Media license url.
location
Media location.
categories
Media categories.
views
Media views.
views_last_month
Media last month views.
comments
Media comments.
comments_last_month
Media last month comments.
layout_preset
Media layout description.
autocam_data
Autocam data per layout layer.
origin
Media origin.
folder_name
The folder name of the channel public and private content (used to build thumbnail path or url).
can_edit
True if user can edit media.
can_delete
True if user can delete media.
external_ref
The media external reference value.
external_data
The media external data.

/api/v2/medias/get/zip/

mediaserver.api.v2.views.media.api_get_zip(request)

This url returns the metadata zip for the requested media. The user making the request must have the community settings edition permission.

Request method: GET, HEAD

Request args:

[api_key]
See documentation index.
oid
Media object id.
[annotations]

Values:

  • “all”: All annotations will be included in the metadata file.
  • “editorial”: Only editorial annotations will be included in the metadata file.
  • “none”: No annotations will be included in the metadata file. Chapters and slides will still be included. “none” is the default value.
[resources]
Values: “yes” or “no”, default is “yes”. Include or not resources links in the metadata file.

Response (if success):

The response body is the zip file content.

/api/v2/medias/add/

mediaserver.api.v2.views.media.api_add(request)

This url can be used to add a new media using a metadata zip package (metadata.xml documentation here ), a media file or an upload id code (multipart upload).

Request method: POST

Request args:

[api_key]
See documentation index.
[file]
A metadata zip package or a media file. This field is ignored if a value is given for the field “code”. To add a media using a YouTube video, upload a file containing the YouTube video id or URL and use “.youtube” as extension for the file. To add a media using an embed code, upload a file containing the embed code and use “.embed” as extension for the file.
[file_url]
An url pointing to a media file. This file will be downloaded and hosted by the platform. If the given value does not have a protocol specified, the https protocol will be used (relative urls are not allowed). To add a video using an embed code, you can send the embed code content in this field and prefix the content with “embed://”. This field is ignored if a value is given for the field “file” or “code”.
[code]
An upload id code (multipart upload).
[title]
The media title (ignored if the file is a metadata zip package).
[type]
The media type. Possible values: “l” or “live” for live stream, “p” or “pgroup” for photos group, any other value or no value will be interpreted as a video on demand media.
[creation]
The media creation date (recording date for videos). Date format is: “YYYY-MM-DD hh:mm:ss” (in python: “%Y-%m-%d %H:%M:%S”). The date will use MediaServer local time zone (the API /api/time/ gives the server local date as a list. The list elements are: year 4 digits, month 0-11, day 1-31, hour 0-23, minute 0-59, second 0-59).
[channel]
The media parent channel. See documentation index to get information on channels identifiers.
[own_media]
The user who made the request will be set as owner (speaker) of the media added. Values: “yes” or “no”, default depends on channel in which the media is added.
[transcode]
Start a transcoding task on media. Values: “yes” or “no”, default is “yes” unless a metadata zip package is sent.
[detect_slides]
Enable or not the automatic extraction of slides from the video file. Values: “yes” or “no” or “auto”, default is “auto”: slides detection will be enabled if a layer in “layout_preset” contains “enable_change_detection”: true and if no slides exist.
[ocr]
Extract keywords from the slides using optical character recognition. Values: “yes” or “no”, default is “no” but it will be automatically enabled if slides detection was enabled.
[autocam]
Run or not the autocam analysis on the video. Values: “yes” or “no” or “auto”, default is “auto”: autocam analysis will be ran if a layer in “layout_preset” contains “enable_autocam”: true and if no autocam data are set. Autocam is an optional feature of MediaServer.
[priority]
Priority for tasks. Values: “low”, “normal” (default), “high”. For transcoding tasks using priority levels “normal” and “high”, a malus is applied depending on the number of queued transcoding tasks. The value with the malus applied is always bigger than the previous priority level value.

Extra metadata request args:

[origin]

A text describing the device or application which requested the media add. Example:

“autopublisher v1.6 on example.com”
[layout]
Media layout, can be: “video”, “webinar” or “composition”. Use “composition” for the multi angle player. The layout is “video” by defaut.
[layout_preset]

Json that contains streams position and type. Example:

{
  "name" : "Cam + PC",
  "layers": [
    {
      "enabled": True, // Diplayed
      "label": "Camera 1", // Display name
      "id" : 1, // layer identifier
      "x": 5, // Display params
      "y": 30,
      "w": 255,
      "h": 300,
      "z": 1 // z-order for PiP config,
      "source": {
          "type": "video" / "image" // all video type will be in thumbnail bar in webgl player
          "path": "image.png", // if image
          "roi": {"x": 0, "y": 0, "w": 320, "h": 240}, // To crop in video
          "change_detection_enabled": true, // To enable slide detection
          "change_detection_threshold": 0.1, // slide detection sensibilty
       }
    }
  ],
  "display_area": {
    "w": 1920,
    "h": 1080,
  }
  "thumbnail_area_height_percent": 10,
  "dynamic_compositing": {
    "displayed": True // shows the "auto" toggle in thumb bar,
    "enabled": True // initial state
  },
  "user_control_enabled": True, // disables clicking, will hide the thumbnail bar
}
[autocam_data]
Only applicable to videos on demand. Json that contains autocam data per layout layer.
[speaker_name]
Speaker name.
[speaker_email]
Speaker email.
[speaker_id]
Speaker identifier.
[company_name]
Company name.
[company_url]
Company url.
[license_name]
License name.
[license_url]
License url.
[location]
Media location.
[description]
Media description.
[keywords]
Media keywords (comma separated values ‘a,b’).
[slug]
Media slug (used for media url). A random number will be added to the slug, so the media won’t use exactly the given value.
[language]
Media language.
[validated]
Media is validated (published). Values: “yes” or “no”. If no value is set, the value will be set according to the channel settings.
[start_publication_date]
Publish media after this date
[end_publication_date]
Unpublish media after this date.
[unlisted]
Media is unlisted. Values: “yes” or “no”.
[display_viewers]
Display viewers count. Values: “yes” or “no”.
[display_channel_videos]
Display channel videos. Values: “yes” or “no”.
[display_channel]
Display channel information. Values: “yes” or “no”.
[display_rss_links]
Display RSS links. Values: “yes” or “no”.
[display_sharing]
Display sharing tab. Values: “yes” or “no”.
[display_permalinks]
Display permalink. Values: “yes” or “no”.
[display_social_links]
Display social links. Values: “yes” or “no”.
[display_embeds]
Display embed codes. Values: “yes” or “no”.
[display_downloads]
Display download links. Values: “yes” or “no”.
[allow_comments]
Allow comments on this media. Values: “yes” or “no”.
[moderation_enabled]
Enable annotations moderation for this media. Values: “yes” or “no”.
[allow_anonymous_actions]
Anonymous could psot public annotations in this media. Values: “yes” or “no”.
[allow_anonymous_votes]
Anonymous could vote for annotations in this media. Values: “yes” or “no”.
[categories]
The media categories (separate values with line returns). Depending on the global configuration, the categories that are not present in the global settings will either cause the media to be rejected or will be added in the global list.
[external_ref]
External reference.
[external_data]
External data.
[transcription]
Only applicable to videos on demand. Media transcription.
[text_before_live]
Only applicable to live streams. Text displayed instead of the player when the live stream is in preparation status.
[text_after_live]
Only applicable to live streams. Text displayed instead of the player when the live stream is in finished status.

Response (if success):

success
True
oid
Created media object id.
slug
Created media slug.

/api/v2/medias/add/zoom/

mediaserver.api.v2.views.media.api_add_from_zoom(request)

This url can be used to add a new media using zoom webhook

Request method: POST

Request GET params:

[api_key]
See documentation index.
[**metadata] in GET params
Any POST arguments of the /api/v2/medias/add/ call can be given to this API call as a GET argument. Those fields could be overwriten by zoom data: origin, speaker_email, channel_identifier, title, own_media, external_ref, external_data

Request body:

all zoom webhook args in json

{
    "event": "recording.completed",
    "payload": {
        "account_id": "lAAAAAAAAAAAAA",
        "object": {
            "uuid": "dj12vck6sdTn6yy7qdy3dQg==",
            "id": 150000008,
            "host_id": "uLobbbbbbbbbb_qQsQ",
            "topic": "A test meeting",
            "type": 2,
            "start_time": "2019-07-11T20:00:00Z",
            "duration": 1,
            "timezone": "America/Los_Angeles",
            "host_email": "somemeail@someemailservice.fjdjf",
            "total_size": 529758,
            "recording_count": 4,
            "share_url": "https://zoom.us/recording/share/aaaaaannnnnldglrkgmrmhh",
            "recording_files": [
                {
                    "id": "8f88599d-19ca-4d2b-a965-1196e777cb3c",
                    "meeting_id": "bpKUheqtRLifLBcIYVJLZw==",
                    "recording_start": "2019-07-23T22:14:57Z",
                    "recording_end": "2019-07-23T22:15:41Z",
                    "file_type": "MP4",
                    "file_size": 282825,
                    "play_url": "https://zoom.us/recording/play/80ebRwsfjskf2H3vlSigX0gNlBBBBBBBBBBBBBB",
                    "download_url": "https://zoom.us/recording/download/80ebRwsfjskf2H3vlSigX0gNlBBBBBBBBBBBBBB",
                    "status": "completed",
                    "recording_type": "shared_screen_with_speaker_view"
                },
                {
                    "id": "a6b332f9-2246-49e5-913e-588adc7f0f5f",
                    "meeting_id": "bpKUheqtRLifLBcIYVJLZw==",
                    "recording_start": "2019-07-23T22:14:57Z",
                    "recording_end": "2019-07-23T22:15:41Z",
                    "file_type": "M4A",
                    "file_size": 246560,
                    "play_url": "https://zoom.us/recording/play/Oaevut8LSACCCCCCCCnnnnnnnnbbbb",
                    "download_url": "https://zoom.us/recording/download/Oaevut8LSACCCCCCCCnnnnnnnnbbbb",
                    "status": "completed",
                    "recording_type": "audio_only"
                },
                {
                    "meeting_id": "bpKUheqtRLifLBcIYVJLZw==",
                    "recording_start": "2019-07-23T22:14:57Z",
                    "recording_end": "2019-07-23T22:15:41Z",
                    "file_type": "TIMELINE",
                    "download_url": "https://zoom.us/recording/download/2dBBBBBccccDDDDeeee"
                },
                {
                    "id": "97a4f7ca-e7e8-4e3b-b28a-27b42cd33c09",
                    "meeting_id": "bpKUheqtRLifLBcIYVJLZw==",
                    "recording_start": "2019-07-23T22:14:57Z",
                    "recording_end": "2019-07-23T22:15:41Z",
                    "file_type": "TRANSCRIPT",
                    "file_size": 373,
                    "play_url": "https://zoom.us/recording/play/7h0BBBBBBBchfhfhffh_0AAAAbbbbbeeSFcf209m",
                    "download_url": "https://zoom.us/recording/play/7h0BBBBBBBchfhfhffh_0AAAAbbbbbeeSFcf209m",
                    "status": "completed",
                    "recording_type": "audio_transcript"
                }
            ]
        }
    }
}
Response (if success):
success
True
oid
VOD object id

/api/v2/medias/edit/

mediaserver.api.v2.views.media.api_edit(request)

This url can be used to edit an existing media. Omitted fields are unchanged.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.

Base fields (only requires edition permission on media):

[title]
The media title.
[description]
The media description.
[keywords]
The media keywords (comma separated values “a,b”).
[language]
The media language.
[categories]
The media categories (separate values with line returns). Depending on the global configuration, the categories that are not present in the global settings will either cause the media to be rejected or will be added in the global list.
[thumb]
The media thumbnail image (a file is expected).
[thumb_index]
An integer value to replace the media thumbnail image with an image from the video. Uusually, the value can be a integer from 0 (10%) to 9 (90%). A negative value can be used to target a slide, in that case the given value must be the time of the slide (in seconds).
[thumb_remove]
Delete current media thumbnail image.
[transcription]
Only applicable to videos on demand. Media transcription.
[text_before_live]
Only applicable to live streams. Text displayed instead of the player when the live stream is in preparation status.
[text_after_live]
Only applicable to live streams. Text displayed instead of the player when the live stream is in finished status.

Publishing fields (requires edition permission on media and edition permission of publishing settings):

[slug]
The media slug (used for media url). A random number will be added to the slug, so the media won’t use exactly the given value.
[channel]
The media parent channel. See documentation index to get information on channels identifiers.
[channel_create]
Allow or not channels creation when targetting channels that do not exist. Values: “yes” or “no”, default is “no”.
[validated]
Media is validated (published). Values: “yes” or “no”.
[start_publication_date]
Publish media after this date
[end_publication_date]
Unpublish media after this date.
[unlisted]
Set media as unlisted. Values: “yes” or “no”.

Advanced fields (requires edition permission on media and edition permission of advanced settings):

[creation]
The media creation date (recording date for videos). Date format is: “YYYY-MM-DD hh:mm:ss” (in python: “%Y-%m-%d %H:%M:%S”). The date will use MediaServer local time zone (the API /api/time/ gives the server local date as a list. The list elements are: year 4 digits, month 0-11, day 1-31, hour 0-23, minute 0-59, second 0-59).
[speaker]
Speaker name.
[speaker_email]
Speaker email.
[speaker_id]
Speaker identifier.
[company]
Company name.
[company_url]
Company url.
[license]
License name.
[license_url]
License url.
[location]
Media location.
[external_ref]
External reference.
[external_data]
External data.
[status]
Only applicable to live streams. The live stream status (“planned”, “ongoing”, “finished”).
[status_auto_detection]
Only applicable to live streams. Allow or not UbiCast recorders to change the live stream status in finished status. Values: “yes” or “no”.

Community fields (requires edition permission on media and edition permission of community settings):

[display_viewers]
Display viewers count. Values: “yes” or “no”.
[display_channel_videos]
Display channel videos. Values: “yes” or “no”.
[display_channel]
Display channel information. Values: “yes” or “no”.
[display_rss_links]
Display RSS links. Values: “yes” or “no”.
[display_sharing]
Display sharing tab. Values: “yes” or “no”.
[display_permalinks]
Display permalink. Values: “yes” or “no”.
[display_social_links]
Display social links. Values: “yes” or “no”.
[display_embeds]
Display embed codes. Values: “yes” or “no”.
[display_downloads]
Display download links. Values: “yes” or “no”.
[allow_comments]
Allow comments on this media. Values: “yes” or “no”.
[moderation_enabled]
Enable annotations moderation for this media. Values: “yes” or “no”.
[allow_anonymous_actions]
Anonymous could psot public annotations in this media. Values: “yes” or “no”.
[allow_anonymous_votes]
Anonymous could vote for annotations in this media. Values: “yes” or “no”.

Player settings fields (requires edition permission on media and edition permission of player settings):

[layout]
Media layout, can be: “video”, “webinar” or “composition”. Use “composition” for the multi angle player. The layout is “video” by defaut.
[layout_preset]

Json that contains streams position and type. Example:

{
  "name" : "Cam + PC",
  "layers": [
    {
      "enabled": True, // Diplayed
      "label": "Camera 1", // Display name
      "id" : 1, // layer identifier
      "x": 5, // Display params
      "y": 30,
      "w": 255,
      "h": 300,
      "z": 1 // z-order for PiP config,
      "source": {
          "type": "video" / "image" // all video type will be in thumbnail bar in webgl player
          "path": "image.png", // if image
          "roi": {"x": 0, "y": 0, "w": 320, "h": 240}, // To crop in video
          "change_detection_enabled": true, // To enable slide detection
          "change_detection_threshold": 0.1, // slide detection sensibilty
       }
    }
  ],
  "display_area": {
    "w": 1920,
    "h": 1080,
  }
  "thumbnail_area_height_percent": 10,
  "dynamic_compositing": {
    "displayed": True // shows the "auto" toggle in thumb bar,
    "enabled": True // initial state
  },
  "user_control_enabled": True, // disables clicking, will hide the thumbnail bar
}
[autocam_data]
Only applicable to videos on demand. Json that contains autocam data per layout layer.

Response (if success):

success
True
oid
Media object id.
slug
Media slug.

/api/v2/medias/edit/autocam/

mediaserver.api.v2.views.media.api_edit_autocam(request)

This url can be used to edit the autocam data of an existing media. Only applicable to videos on demand.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.
layer_data
Json that contains autocam data for a layout layer.
[clear]
Clear autocam data of the media before adding posted layer data. Possible values “yes” or “no”, default is “no”.

Response (if success):

success
True
oid
Media object id.
autocam_data
Json that contains autocam data for all layout layers.

/api/v2/medias/delete/

mediaserver.api.v2.views.media.api_delete(request)

This url deletes the requested media. You need at least one of the option delete_metadata or delete_resources. You need the two options delete_resources and delete_metadata to entierly delete a media.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.
[delete_metadata]
Delete media entry. Possible values “yes” or “no”, default is “no”.
[delete_resources]
Delete media resources in hosting service (only applicable to videos on demand). Possible values “yes” or “no”, default is “no”.

Response (if success):

success
True
message
The deletion result message.
warning
Boolean that indicates if the deletion has partially failed.

/api/v2/medias/add-thumb/

mediaserver.api.v2.views.media.api_add_thumb(request)

This url can be used to add a thumbnail image to a media.

Request method: POST

Request args:

[api_key]
See documentation index.
file
The thumbnail image (jpg or png).
oid
Media object id.
use
Possible values: “yes” or “no” (default). Tells if the thumbnail must be used (automatic if it is the first one) or just added.

Response (if success):

success
True

/api/v2/medias/clear-thumbs/

mediaserver.api.v2.views.media.api_clear_thumbs(request)

This url can be used to remove all stored thumbnail images of a media and optionnaly the current one.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
Media object id.
current
Possible values: “yes” or “no” (default). Remove current thumbnail.

Response (if success):

success
True

Media resources

/api/v2/medias/modes/

mediaserver.api.v2.views.media_resources.api_modes(request)

This url returns the available modes (quality) with the best matching resource depending on url arguments.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
The media object id.
[maxheight]
Maximum height of resources.
[credits]
Get video credits resources (called intro and outro). “yes” or “no”, default is “yes”.
[<player>]
Specify what resouces format can be returned for a given player type. For example: “?html5=webm_mp3_m3u8&embed=embed&yt=yt” will return resources for html5, embedded and YouTube players with extensions in the specified format list. Use “?all” to allow all player and formats.

Response (if success):

success
True
modes
Dictionnary with modes information.
modes_names
List of modes names.

/api/v2/medias/playlist/

mediaserver.api.v2.views.media_resources.api_adaptive_playlist(request)

This url returns the adaptive modes (quality) with the best matching resource depending on url arguments.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
The media object id.
[h]
Desired height for playback.
[json]
Returns the playlist as json instead of “application/x-mpegURL” content. “yes” or “no”, default is “no”.

Response (if success and json):

success
True
playlist
The playlist content.

/api/v2/medias/resources-list/

mediaserver.api.v2.views.media_resources.api_list_resources(request)

This url returns the resources list of a media.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
The media object id.
[client_ip]
Specify the IP of client. The resource links depends on client IP if routing rules are defined in the configuration. Use “requester” to use requester IP. If no IP and no user field are set, routing rules are ignored.
[user_X]
User data to use to match routing rule if any. Replace “X” by the user field you want to simulate. For example, you can send: “user_username=test&user_email=test@test.com”. If no IP and no user field are set, routing rules are ignored.

Response (if success):

success
True
resources
List of resources.

/api/v2/medias/resources-info/

mediaserver.api.v2.views.media_resources.api_resources_info(request)

This url returns some information about resources of a video (only for VOD). The user must be able to edit the video.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
The media object id.

Response (if success):

success
True
deletable
True if the resources can be deleted from the hosting service.
sharing
list of videos sharing the same resources.

/api/v2/medias/resources-check/

mediaserver.api.v2.views.media_resources.api_resources_check(request)

This url forces a refresh of media resources (only for VOD).

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.
[file_name]
The file name to check. If not specified, all files will be checked.

Response (if success):

success
True

/api/v2/medias/resources-rename/

mediaserver.api.v2.views.media_resources.api_rename_resource(request)

This url allows to rename a resource file of a media (only for VOD). The file to rename must be hosted by the portal.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.
name
The resource file name.
new_name
The resource file new name.

Response (if success):

success
True

/api/v2/medias/resources-move/

mediaserver.api.v2.views.media_resources.api_resources_move(request)

This url allows to update all local resources manager of a video and to move local resources to object storage. This url is unavailable when object storage is not configured. This url will return a failure if the media is currently being processed by a task.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.

Response (if success):

success
True

/api/v2/medias/resources-delete/

mediaserver.api.v2.views.media_resources.api_delete_resources(request)

This url allows to delete resource files of a media (only for VOD). A list of the files to delete must be provided.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.
names
The list of file names to delete. Use comas to separate names.

Response (if success):

success
True

/api/v2/medias/generate-hls/ (DEPRECATED)

mediaserver.api.v2.views.media_tasks.api_generate_hls(request)

This url allows to generate an HLS file from a MP4 file.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
Media object id.
source
The name of the mp4 file to use.

Response (if success):

success
True

Permissions

/api/v2/perms/get/

mediaserver.api.v2.views.perms.perms_get(request)

This url returns permissions of all sub channels and media of a channel.

Request method: GET

Request args:

[api_key]
See documentation index.
type
Can be “user” or “group”.
id
Database id of user or group.
[oid]
Parent channel, if no value is sent, the root will be used.
[recursive]
Look for permissions inherited from parent channels in addition of these inherited from groups. Possible values: yes, no (default is no).

Response (if success):

success
True
[global_permissions]
Global permissions, only present when no oid is given.
[permissions]
Permissions on the root, only present when no oid is given.
[channels]
List of channels with channel basic information and channels permissions.
[videos]
Similar to channels.
[lives]
Similar to channels.
[pgroups]
Similar to channels.

/api/v2/perms/get/default/

mediaserver.api.v2.views.perms.perms_get_default(request)

This url returns default permissions of a channel or a media.

Request method: GET

Request args:

[api_key]
See documentation index.
[oid]
Channel or media object id, if no object id is given, the root will be used.
[recursive]
Look for permissions inherited from parent channels in addition of these inherited from groups. Possible values: yes, no (default is yes).

Response (if success):

success
True
auth-*
List of default permissions for each user groups.

/api/v2/perms/get/for-content/

mediaserver.api.v2.views.perms.perms_get_for_content(request)

This url returns all users and groups who have direct permissions on the requested channel, media or on the root.

Request method: GET

Request args:

[api_key]
See documentation index.
[oid]
Channel or media object id, if no object id is given, the root will be used.
[users]
Get the users list.
[groups]
Get the groups list.
[auth_groups]
Get authentication groups list.
[csv]
Get the results in a CSV file.
[delimiter]
CSV file delimiter character.
[quote]
CSV file quote character.
[encoding]
CSV file encoding. Possible values: utf-8, cp1252 (default is utf-8).

Response (if success):

success
True
users
List of users with their direct permissions.
groups
List of groups with their direct permissions.

/api/v2/perms/edit/

mediaserver.api.v2.views.perms.perms_edit(request)

This url allows to edit permissions on a channel or a media.

Request method: POST

Request args:

[api_key]
See documentation index.
type
Can be “user” or “group”.
id
Database id of user or group. Value can be “ldap” to retrive user / group using LDAP (“ldap_uid” must be given in this case).
[ldap_uid]
The LDAP unique identifier: “username” for users and “name” for groups.
[oid]

Object on which permissions will be edited.

Use “0” to change permissions on the root. If no oid is given, the global permissions will be changed.

[profile]

The name of the permissions profile to apply.

By default, available profiles are “guest” (remove all permissions), “moderator” (give moderation permissions on all media), “manager” (give all permissions on channels and media), “admin” (give all permissions) or “recorder” (give permissions required for UbiCast recording systems).

**data

If a profile is given, data are ignored.

Allowed values for all data fields are “True”, “False”, “”.

Use “” to set a permission as not defined (inherited).

Fields for global permissions:
  • can_create_channel
  • can_create_media
  • can_create_polls
  • can_have_personal_channel
  • can_change_settings
  • can_change_skin
  • can_change_users
  • can_manage_keywords
  • can_manage_subtitles
  • can_manage_lives
  • can_see_arch_stats
  • can_control_recorders
  • can_move_content
  • can_change_advanced
  • can_use_player_tab
  • can_use_appearance_tab
  • can_use_trimming_tab
  • can_use_slides_tab
  • can_use_community_tab
  • can_use_attachments_tab
  • can_use_photos_tab
  • can_use_widgets_tab
  • can_use_audio_tab
  • can_use_resources_tab
  • can_use_permissions_tab
Fields for channel permissions:
  • can_access_channel
  • can_add_channel
  • can_change_channel
  • can_delete_channel
  • can_see_stats_channel
  • can_access_media
  • can_add_media
  • can_change_media
  • can_publish_media
  • can_delete_media
  • can_see_stats_media
  • can_moderate_media
  • can_subtitle_media
Fields for media permissions:
  • can_access_media
  • can_change_media
  • can_publish_media
  • can_delete_media
  • can_see_stats_media
  • can_moderate_media
  • can_subtitle_media

Response (if success):

success
True
msg
The response message.
type
The permissions owner type.
id
The permissions owner id.

/api/v2/perms/edit/default/

mediaserver.api.v2.views.perms.perms_edit_default(request)

This url allows to edit default permissions on a channel or a media.

Request method: POST

Request args:

[api_key]
See documentation index.
[oid]
Channel or media object id, if no object id is given, the root will be used.
[unlisted]
If any value is given, the unlisted setting will be set as enabled on the channel or media, otherwise it will be disabled. Only applicable when an object id is given.
[prefix]
Choose the permissions fields prefix. Allowed values: “id” or “reference”. Default is “id”.
**data
Same permissions fields as in the edit permissions call. Fields must be prefixed with the id or the reference of the group. For example: null-can_access_channel=False (to change anonymous permissions) or 21-can_access_channel=False (to change the permissions of the authentication group 21) or users-anonymous-can_access_channel=False (to change anonymous permissions).
email_collection_access
Enable email collection (only applicable for media and if the email collection feature is enabled). Boolean value, send any data in this field to enable it and omit the field to disable it.
email_collection_piu_required
Require personal information use agreement in the email collection form (only applicable for media and if the email collection feature is enabled). Boolean value, send any data in this field to enable it and omit the field to disable it.

Response (if success):

success
True
msg
The response message.

/api/v2/perms/profiles/

mediaserver.api.v2.views.perms.perms_profiles(request)

This url returns all permissions profiles information.

Request method: GET

Request args:

[api_key]
See documentation index.
[context]
The context of the profiles to return. Can be “”, “channel”, “media”, “lti” or an object id. If empty or not set, the permissions profiles applicable on users/groups will be returned. If an object id is given, profiles applicable on given content will be returned.

Response (if success):

success
True
profiles
An object composed of profiles names and profiles information. If no profiles are available, null is returned. Example of value:
{
    "admin": {
        "id": 1,
        "name": "admin",
        "label": "Administrator: A profile with all permissions.",
        "label_display": "Administrator: A profile with all permissions.", // The profile description label translated if possible.
        "internal": true, // Boolean indicating if the profile is a built in profile that cannot be altered.
        "active": true, // Boolean indicating if the profile can be selected in permissions edition pages.
        "context": "", // Can be "", "channel", "media" or "lti".
        "level": 1754, // An integer representing the number of permissions the profile have.
        "storage_quota": 14, // An integer or null representing the storage quota to apply on user accounts. If a negative value is set, it means that the storage quota of user accounts should be preserved.
        "perms_ignore_auth_grps": "",
        "can_create_channel": true,
        "can_create_media": true,
        "can_create_polls": true,
        "can_have_personal_channel": true,
        "can_change_settings": true,
        "can_change_skin": true,
        "can_change_users": true,
        "can_manage_keywords": true,
        "can_manage_subtitles": true,
        "can_manage_lives": true,
        "can_see_arch_stats": true,
        "can_control_recorders": true,
        "can_move_content": true,
        "can_change_advanced": true,
        "can_use_player_tab": true,
        "can_use_appearance_tab": true,
        "can_use_trimming_tab": true,
        "can_use_slides_tab": true,
        "can_use_community_tab": true,
        "can_use_attachments_tab": true,
        "can_use_photos_tab": true,
        "can_use_widgets_tab": true,
        "can_use_audio_tab": true,
        "can_use_resources_tab": true,
        "can_use_permissions_tab": true,
        "can_access_channel": true,
        "can_add_channel": true,
        "can_change_channel": true,
        "can_delete_channel": true,
        "can_see_stats_channel": true,
        "can_access_media": true,
        "can_add_media": true,
        "can_change_media": true,
        "can_publish_media": true,
        "can_delete_media": true,
        "can_see_stats_media": true,
        "can_moderate_media": true,
        "can_subtitle_media": true,
        "can_access_media": true,
        "can_change_media": true,
        "can_publish_media": true,
        "can_delete_media": true,
        "can_see_stats_media": true,
        "can_moderate_media": true,
        "can_subtitle_media": true
    },
    "success": true
}

Recorders control

/api/v2/recorders/

mediaserver.api.v2.views.recorders.recorders_list(request)

This url returns a list of recorder systems. Requires the “can_control_recorders” and the “can_change_settings” permissions.

Request method: GET

Request args:

Response (if success):

success
True
recorders

List of objects with the following fields:

hostname
The recorder host name.
name
The recorder name.
location
The recorder location.
status
The recorder status.
status_display
The recorder status display text.
last_status_update
The recorder last status update date.
last_status_update_display
The recorder last status update date display text (the date is always in UTC time zone).
url
The control page url of the recorder.
qrcode
The QRcode url to the control page url of the recorder.

/api/v2/recorders/control/

mediaserver.api.v2.views.recorders.recorders_control(request)

This url returns the url to use to control a recorder system on Miris Manager. The control page url can only be used once. To access it, an access token is generated when calling this API url and is consumed when Miris Manager control page is opened. The token is valid for the duration of a browsing session on Miris Manager, after this delay, the token will be rejected by Miris Manager. Requires the “can_control_recorders” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
recorder
The host name of the recorder system from Miris Manager.
[user_id]
The id (integer) of the user account to use to fill recordings metadata. If this field is not set, the metadata of the user account making the API call will be used. The permission to change_settings is required to use this field (to limit usage to administrators).
[user_email]
The email address of the user account to use to fill recordings metadata. This field is ignored if an “user_id” is set. If this field is not set, the metadata of the user account making the API call will be used. The permission to change_settings is required to use this field (to limit usage to administrators).

Response (if success):

success
True
url
The Miris Manager control page url with the access token.

Resources routing rules

/api/v2/routing/

mediaserver.api.v2.views.routing.routing_list(request)

This url returns a list of routing rules.

Request method: GET

Request args:

[api_key]
See documentation index.
[offset]
Start the result list at a given index, similar to SQL offset. Default: 0.
[limit]
Maximum number of results returned. Default: 50. Use 0 to remove limit (the request can be very long and the offset will be ignored).
[order_by]
Order the result list by the given field.
[search]
Search in the result list.
[search_in]
Specify the fields used to do the search.
[search_exact]
Match only fields with the exact value.

Response (if success):

success
True
rules

List of objects with the following fields:

  • id
  • name
  • enabled
  • priority
  • user_field
  • user_cond
  • res_cond
  • reroute_to
  • use_proxy

/api/v2/routing/get/

mediaserver.api.v2.views.routing.routing_get(request)

This url returns information about a rule.

Request method: GET

Request args:

[api_key]
See documentation index.
id|name
Id or name of rule.

Response (if success):

success
True
rule

Object with the following fields:

  • id
  • name
  • enabled
  • priority
  • user_field
  • user_cond
  • res_cond
  • reroute_to
  • use_proxy

/api/v2/routing/add/

mediaserver.api.v2.views.routing.routing_add(request)

This url allows to add rule.

Request method: POST

Request args:

[api_key]
See documentation index.
name
Rule name.
[enabled]
If this argument is sent, the rule will be enabled.
priority
Rule priority.
user_field
Rule user field to check.
user_cond
Rule user field value to match.
res_cond
Rule resources to match.
reroute_to
Rule new server url.
[use_proxy]
If this argument is sent, the rule proxy flag will be set.

Response (if success):

success
True
msg
Message.
id
New rule id.

/api/v2/routing/edit/

mediaserver.api.v2.views.routing.routing_edit(request)

This url allows to edit a rule settings.

Request method: POST

Request args:

[api_key]
See documentation index.
id
Id of rule to edit.

Rule data to update:

name
Rule name.
[enabled]
If this argument is sent, the rule will be enabled.
priority
Rule priority.
user_field
Rule user field to check.
user_cond
Rule user field value to match.
res_cond
Rule resources to match.
reroute_to
Rule new server url.
[use_proxy]
If this argument is sent, the rule proxy flag will be set.

Response (if success):

success
True
msg
Message.

/api/v2/routing/delete/

mediaserver.api.v2.views.routing.routing_delete(request)

This url deletes the requested rule.

Request method: POST

Request args:

[api_key]
See documentation index.
id|name
Id or name of rule.

Response (if success):

success
True

Server status

/api/time/

mediaserver.api.views.get_time(request)

This url returns the current time of the server. The date is in JavaScript format so the month goes from 0 to 11.

Request method: GET

Request args:

[utc]
If present in request (any value), the date is returned for the UTC time zone.

Response:

The date as a list of integers (year, month-1, day, hour, minute, second).

/api/v2/

mediaserver.api.v2.views.base.ping(request)

This url can be used to test if the server is responding.

Request method: GET

Response (if success):

success
True
mediaserver
The version of Mediaserver.

/api/v2/get-version/

mediaserver.api.v2.views.base.get_version(request)

This urls is used to get currently used version of some components.

Request method: GET

Request args:

[api_key]
See documentation index. Only the master API key can be used.

Response (if success):

success
True
mediaserver
The version of Mediaserver.
django
The version of Django.
djwutils
The version of Django web utils.
celerity
The version of Celerity.

Storage

/api/v2/storage/

mediaserver.api.v2.views.storage.storage_global(request)

This url returns information on the global storage usage. No information will be returned if the site is not allowed to access to the storage data.

Request method: GET

Request args:

[api_key]
See documentation index. Only the master API key can be used.

Response (if success):

success
True
global_storage_size
Storage total size.
global_storage_available_display
Storage available space.
global_storage_available_percent
Storage available space in percents.
global_storage_instance_display
Storage used by instance.
global_storage_instance_percent
Storage used by instance in percents.
global_storage_system_display
Storage used by system files.
global_storage_system_percent
Storage used by system files in percent.
global_storage_warning
Boolean to indicate if the remaining space is low.

/api/v2/storage/info/

mediaserver.api.v2.views.storage.storage_info(request)

This url returns information on the storage usage for an item (channel or media).

Request method: GET

Request args:

[api_key]
See documentation index. Only the master API key can be used.
[oid]
The item object id. If no object id is given, the user’s personal channel will be targetted. If the item does not exist, a reponse with code 404 will be returned.

Response (if success):

success
True
storage_used_public
The number of bytes used to store the item public files.
storage_used_protected
The number of bytes used to store the item protected files.
storage_used_sub
The number of bytes used to store the item content.
storage_used
The total number of bytes used to store the item.
[storage_quota]
Only applicable to channels. The maximum number of bytes that can be used by the channel.
[storage_warning]
Only applicable to channels. The threshold in percents after which an email will be sent to channel managers.

/api/v2/storage/update/

mediaserver.api.v2.views.storage.storage_update(request)

This url triggers an update of the storage usage for an item (channel or media).

Request method: POST

Request args:

[api_key]
See documentation index. Only the master API key can be used.
[oid]
The item object id. If no object id is given, the user’s personal channel will be targetted. If the item does not exist, a reponse with code 404 will be returned.

Response (if success):

success
True
delta
Storage usage delta (in bytes). The delta will be 0 if the storage usage was already up to date. A negative value means that the item storage usage has decreased since last update and a positive value means that the storage usage has increased.
storage_used_public
The number of bytes used to store the item public files.
storage_used_protected
The number of bytes used to store the item protected files.
storage_used_sub
The number of bytes used to store the item content.
storage_used
The total number of bytes used to store the item.
[storage_quota]
Only applicable to channels. The maximum number of bytes that can be used by the channel.
[storage_warning]
Only applicable to channels. The threshold in percents after which an email will be sent to channel managers.

Statistics

The following API allows to access some statistics.

/api/v2/stats/connections/

mediaserver.api.v2.views.stats.api_connections(request)

This url returns the number of connected IPs on port 443.

Request method: GET

Request args:

Response (if success):

success
True
connections
Number of connected IPs.

/api/v2/stats/viewers/

mediaserver.api.v2.views.stats.api_viewers(request)

This url returns the current number of viewers on a media or on all media.

Request method: GET

Request args:

[api_key]
See documentation index.
[oid]
Media object id. Only VOD and live can be used.

Response (if success):

success
True
current_viewers
Current number of viewers on given media or on all media.
maximum_viewers
Maximum number of viewers (whole site). 0 means no limit.
[viewers_peak]
Number of viewers peak. Only shown if no media is specified.
[viewers_peak_date]
Date when the number of viewers peak has been observed. Only shown if no media is specified.

/api/v2/stats/global/

mediaserver.api.v2.views.stats.api_global(request)

This url returns the global statistics data for the requested time period.

Request method: GET

Request args:

[api_key]
See documentation index.
[period]
Can be: “all” (statistics from first media access to today), “last_month”, “last_year”.
[sd]
The starting date of the period. Ignored if “period” is specified.
[ed]
The ending date of the period. Ignored if “period” is specified.

Response (if success):

success
True
start_date
The starting date of the returned period.
end_date
The ending date of the returned period.
accesses
The count of accesses for all medias.
views
The count of views for all medias.
total_views_time
The total of viewing time for all medias.
avg_view_time
The average viewing time for all medias.
avg_video_percent_viewed
The average percentage for all medias viewed.
medias_count_start
The total count of medias on the period start date.
medias_count_end
The total count of medias on the period end date.
medias_count_new
The count of new medias during the period of time selected.
medias_duration_start
The duration of medias on the period start date.
medias_duration_end
The duration of medias on the period end date.
medias_duration_new
The duration of new medias during the period of time selected.
videos_count_start
The count of videos on the period start date.
videos_count_end
The count of videos on the period end date.
videos_count_new
The count of new videos.
videos_duration_start
The total duration of videos on the period start date.
videos_duration_end
The total duration of videos on the period end date.
videos_duration_new
The total of new duration during the period of time selected.
videos_accesses
The total count of videos accesses.
videos_views
The total count of videos views.
videos_total_views_time
The total viewing time for all videos.
videos_avg_view_time
The average time viewed for all videos.
videos_avg_video_percent_viewed
The average of the percent time viewed for all videos.
sessions_count_start
The count of sessions on the period start date.
sessions_count_end
The count of sessions on the period end date.
sessions_count_new
The count of new sessions.
sessions_duration_start
The duration of sessions on the period start date.
sessions_duration_end
The duration of sessions on the period end date.
sessions_duration_new
The duration of new sessions.
sessions_accesses
The total of sessions accesses.
sessions_views
The total views sessions.
sessions_total_views_time
The total sessions view time.
sessions_avg_view_time
The average of sessions view time.
sessions_avg_video_percent_viewed
The average of viewed video percent.

/api/v2/stats/channel/

mediaserver.api.v2.views.stats.api_channel(request)

This url returns a channel statistics data for the requested time period.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
Object id of channel for which the stats will be returned.
[recursive]
Get statistics of sub channels media. Can be very long to process. Values: “yes” or “no” (default).
[period]
Can be: “all” (statistics from first media access to today), “last_month”, “last_year”.
[sd]
The starting date of the period. Ignored if “period” is specified.
[ed]
The ending date of the period. Ignored if “period” is specified.

Response (if success):

success
True
start_date
The starting date of the returned period.
end_date
The ending date of the returned period.
totals
accesses
The total of accesses for medias in the specified channel.
views
The total views for medias in the specified channel.
duration
The total duration of medias in the specified channel.
avg_view_time
The average duration of the viewing time.
total_views_time
The total duration of views for medias in the specified channel.
avg_video_percent_viewed
The total average of percentage viewed for all videos.
channels_stats
The requested statistics, grouped by channels.
categories_stats
The requested statistics, grouped by categories.
objects_stats
List of media statistics. Each item has following fields:
obj
The archived media database id.
iframe_url
The url to the statistics page (iframe).
duration
The duration of the media.
sessions
The list of sessions if the media is a live stream.
accesses
The number of access.
views
The number of views.
total_views_time
The total duration of views.
avg_view_time
The average duration of the viewing time.
avg_video_percent_viewed
The average of percentage viewed for all videos.
accesses_rel_percent
The percentage relative to other media of accesses.
views_rel_percent
The percentage relative to other media of views.
total_views_time_rel_percent
The percentage relative to other media of views duration.
avg_view_time_rel_percent
The percentage relative to other media of viewing time.
empty_stats
List of media statistics with no plays during the selected period. Items of the list have same fields as in objects_stats.
csv_exports
Informations about available CSV exports.

/api/v2/stats/unwatched/

mediaserver.api.v2.views.stats.api_unwatched(request)

This url returns a list of unwatched media during the requested period.

Request method: GET

Request args:

[api_key]
See documentation index.
[oid]
Object id of channel for which the media will be returned. If no object id is given, the whole catalog will be checked (can be very long).
[recursive]
Get media from sub channels if a channel object id is given. Can be very long to process. Values: “yes” or “no” (default).
[period]
Can be: “all” (statistics from first media access to today), “last_month”, “last_year”.
[sd]
The starting date of the period. Ignored if “period” is specified.
[ed]
The ending date of the period. Ignored if “period” is specified.

Response (if success):

success
True
start_date
The starting date of the returned period.
end_date
The ending date of the returned period.
videos

List of unwatched videos on demand. The list is built on the following model:

oid
Object id of video.
dbid
Id in database of video.
title
Title of video.
slug
Slug of video.
language
Language of video.
thumb
Url of video’s thumbnail image.
add_date
Media add date (date when the media has been added to the catalog).
creation
Media creation date (recording date for videos on demand).
layout
Media layout (can be “composition” for Dynamic Rich Media, “webinar” for video next to JPEG slides or “” for regular video).
duration
Media duration.
unlisted
True if not listed in the portal (only for editable media).
validated
True if validated (only for editable media).
short_description
Short description of media.
keywords
Keywords of media.
speaker
Media speaker.
speaker_email
Media speaker email.
company
Media company
company_url
Media company url.
license
Media license.
license_url
Media license url.
views
Media views.
views_last_month
Media last month views.
comments
Media comments.
comments_last_month
Media last month comments.
origin
Media origin.
can_edit
True if user can edit this video.
can_delete
True if user can delete this video.
live_streams
List of unwatched live streams. The list is built like the one for videos except that there is no duration field but a status field which indicates the current status of the live stream (“ongoing”, “planned” or “finished”).
csv_exports
Informations about available CSV exports.

/api/v2/stats/categories/

mediaserver.api.v2.views.stats.api_categories(request)

This url returns the categories statistics data for the requested time period.

Request method: GET

Request args:

[api_key]
See documentation index.
[period]
Can be: “all” (statistics from first media access to today), “last_month”, “last_year”.
[sd]
The starting date of the period. Ignored if “period” is specified.
[ed]
The ending date of the period. Ignored if “period” is specified.

Response (if success):

success
True
start_date
The starting date of the returned period.
end_date
The ending date of the returned period.
categories_stats
The requested statistics, grouped by category.

/api/v2/stats/user/

mediaserver.api.v2.views.stats.api_user(request)

This url returns the user statistics data for the requested time period.

Request method: GET

Request args:

user_email
The requested username.
[api_key]
See documentation index.
[period]
Can be: “all” (statistics from first media access to today), “last_month”, “last_year”.
[sd]
The starting date of the period. Ignored if “period” is specified.
[ed]
The ending date of the period. Ignored if “period” is specified.

Response (if success):

success
True
start_date
The starting date of the returned period.
end_date
The ending date of the returned period.
accesses
The total user accesses on medias.
views
The total user views on medias, when some time are played.
played
The total duration played by the user.

Subtitles

The following API allows to manage subtitles files.

/api/v2/subtitles/

mediaserver.api.v2.views.subtitles.api_list(request)

This url allows to list subtitles of a media.

Request method: GET

Request args:

[api_key]
See documentation index.
oid
The media object id.

Response (if success):

success
True
subtitles

Array of subtitles with following fields:

id
The subtitle id.
title
The subtitle title.
lang
The subtitle lang.
file
The subtitle file url.
validated
Boolean to indicate if the subtitle is validated.
added_on
The subtitle add date.
added_by
The username of the user who added the subtitle.
authot_id
The id of the subtitle in the Authot service.
state
The subtitle state in the Authot service.
state_display
The translated state.
auto_transcripted
Boolean that indicates if the subtitle was created from an automatic transcription.
auto_translated
Boolean that indicates if the subtitle was created from an automatic translation.

/api/v2/subtitles/add/

mediaserver.api.v2.views.subtitles.api_add_subtitle(request)

This url allows to add a subtitle file to a media.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.
[lang]
The subtitle language. By default, the video language is used or the site language if the video has no language set. Allowed languages depends on the Authot service license. The format to use is XX-XX, for example: fr-FR or en-GB.
[encoding]
The file encoding. Only “utf8” and “cp1252” are handled.

Request files:

file
The subtitle file. Only .srt and .vtt extensions are allowed.

Response (if success):

success
True
**fields
Same fields as for a subtitle entry of the call to list subtitles (/api/v2/subtitles/).

/api/v2/subtitles/generate/

mediaserver.api.v2.views.subtitles.api_generate_subtitle(request)

This url allows to generate a subtitle file by analysing the media audio (aka transcription) using the Authot service.

Request method: POST

Request args:

[api_key]
See documentation index.
oid
The media object id.
[lang]
The media language to use for transcription. By default, the video language is used or the site language if the video has no language set. Allowed languages depends on the Authot service license. The format to use is XX-XX, for example: fr-FR or en-GB.
[correction]
Request a manual correction of the generated subtitle file. Send any value to enable correction.

Response (if success):

success
True
**fields
Same fields as for a subtitle entry of the call to list subtitles (/api/v2/subtitles/).

/api/v2/subtitles/translate/

mediaserver.api.v2.views.subtitles.api_translate_subtitle(request)

This url allows to translate a subtitle using the Authot service.

Request method: POST

Request args:

[api_key]
See documentation index.
authot_id
The Authot id of the subtitle.
lang
The new language.

Response (if success):

success
True
message
The success message.
**fields
Same fields as for a subtitle entry of the call to list subtitles (/api/v2/subtitles/).

/api/v2/subtitles/set-title/

mediaserver.api.v2.views.subtitles.api_set_subtitle_title(request)

This url allows to change the title of a subtitle.

Request method: POST

Request args:

[api_key]
See documentation index.
id
The id of the subtitle.
title
The new title.

Response (if success):

success
True
message
The success message.

/api/v2/subtitles/validate/

mediaserver.api.v2.views.subtitles.api_validate_subtitle(request)

This url allows to mark a subtitle as validated.

Request method: POST

Request args:

[api_key]
See documentation index.
id
The id of the subtitle.

Response (if success):

success
True
message
The success message.

/api/v2/subtitles/unvalidate/

mediaserver.api.v2.views.subtitles.api_unvalidate_subtitle(request)

This url allows to mark a subtitle as not validated.

Request method: POST

Request args:

[api_key]
See documentation index.
id
The id of the subtitle.

Response (if success):

success
True
message
The success message.

/api/v2/subtitles/delete/

mediaserver.api.v2.views.subtitles.api_delete_subtitle(request)

This url allows to delete a subtitle.

Request method: POST

Request args:

[api_key]
See documentation index.
id
The id of the subtitle.

Response (if success):

success
True
message
The success message.

/api/v2/subtitles/check-status/

mediaserver.api.v2.views.subtitles.api_check_subtitle_status(request)

This url returns the current status of a subtitle in the Authot service.

Request method: GET

Request args:

[api_key]
See documentation index.
id
The id of the subtitle.

Response (if success):

success
True
**fields
Same fields as for a subtitle entry of the call to list subtitles (/api/v2/subtitles/).

/api/v2/subtitles/get-content/

mediaserver.api.v2.views.subtitles.api_get_subtitle_content(request)

This url returns the content of a subtitle using the Authot service.

Request method: GET

Request args:

[api_key]
See documentation index.
authot_id
The Authot id of the subtitle.
[export_format]
The format of the file. Default format is “xml”. See Authot API documentation to get the list of supported format.

Response (if success):

success
True
message
The success message.
title
The title of the subtitle.
text
The content of the subtitle.

/api/v2/subtitles/set-content/

mediaserver.api.v2.views.subtitles.api_set_subtitle_content(request)

This url allows to change the content of a subtitle using the Authot service.

Request method: POST

Request args:

[api_key]
See documentation index.
authot_id
The Authot id of the subtitle.
document
The new content. The format of the content must be XML (as expected by the Authot API).

Response (if success):

success
True
message
The success message.

/api/v2/subtitles/get-remaining-times/

mediaserver.api.v2.views.subtitles.api_get_remaining_times(request)

This url give the remaining times for automatic transcriptions and human correction.

Request method: GET

Request args:

Response (if success):

success
True
auto_remaining_time
Remaining time for automatic transcriptions.
correction_remaining_time
Remaining time for manual transcriptions corrections.

Tasks on media

/api/v2/medias/status/

mediaserver.api.v2.views.media_tasks.api_status(request)

This url returns information about processing tasks on videos.

Request method: GET

Request args:

[oid]
Media object id. If no object id is given, all tasks will be returned.
[all]
By default, only non finished tasks and tasks finished within the last day will be returned. Add this argument to get all tasks.
[iframe]
Give iframe links for trimming childs instead of regular links.

Response (if success):

success
True
id
Task id in database.
uid
Task uid.
action
Task action.
action_display
Task action.
status
Task status.
step
Task step.
step_display
Task translated step.
step_target
Task step target.
progress
Task progress.
message
Task message.
traceback
Task traceback.
video_oid
The media object id.
child_oid
The child media object id (for trimming tasks).

/api/v2/medias/action/

mediaserver.api.v2.views.media_tasks.api_task_action(request)

This url allows to control a task.

Request method: POST

Request args:

id
Id of targetted task.
action
Action to perform on task. Possible values are: retry, cancel or delete.

Response (if success):

success
True
message
A brief message.

/api/v2/medias/task/

mediaserver.api.v2.views.media_tasks.api_start_task(request)

This url allows to start a task (transcoding, trimming, slides detection, ocr analysis) on a video. The user needs to be allowed to modify the video.

Request method: POST

Request args:

oid
The object id of the media.
task
Task type. Possible values: “transcoding”, “trimming”, “change_detect” (slides detection) or “ocr_analyze”.
[params]

Task parameters in json format. For example: {“priority”: “low”}. The “priority” parameter can be set for all task types and accept following values: “low”, “normal” (default) or “high”. For transcoding tasks using priority levels “normal” and “high”, a malus is applied depending on the number of queued transcoding tasks. The value with the malus applied is always bigger than the previous priority level value. Parameters for each task:

transcoding
“behavior” (string): Transcoding task behavior. Can be keep (to keep all existing resources), clean (to remove useless resources) or delete (to delete all existing resources). Default is clean.
trimming
“sequences” (string): Text representation of the sequences to extract from the video. For example: 23-89,106-268. “title” (string): Title of the trimmed child.
change_detect
“allow_changes” (boolean): Allow or not the task to modify existing slides. “crop_areas” (list): Areas to analyze. Should be a list of list with coordinates [x1, y1, x2, y2]. For example: [[100, 60, 550, 660], [600, 60, 800, 660]]. If no value is set, the whole video will be analyzed. “image_threshold” (float): Detection threshold. Default can be changed in global settings and is usually 0.1. With higher values, less slides will be detected. “layer_ids” (list): Layer identifier of each area to analyze. For example: [2]. Used by dynamic Rich Media player for auto pilot feature. “ocr_language” (string): Three letters language code to run OCR on detected slides. For example: fra or eng.
ocr_analyze
“allow_changes” (boolean): Allow or not the task to modify existing slides. “ocr_language” (string): Three letters language code to run OCR on detected slides. For example: fra or eng.

Response (if success):

success
True

Uploads

/api/v2/upload/

mediaserver.api.v2.views.upload.UploadResource(**kwargs)

This url allows to upload files using chunks (file fragments).

Request method: POST

Request headers:

Content-Range
The byte range that is being sent. Example: “bytes 10-20/40”.

Request args:

[api_key]
See documentation index.
[upload_id]
The id refering to the upload. The first request to upload a file should be done with no value.
[live]

Live metadata to start a live stream on uploaded file. Example: (no field is required)

{
    "oid": "live stream object id",
    "channel": "Channel in which the live stream will be added if it is created. Can be the channel title, slug, object id or prefixed with mscid-, mscref-, mscpath-. Defaults to the portal default channel. Ignored if a valid object id is given. ",
    "title": "Awesome Live",
    "layout": "composition",
    "layout_preset": "json string"
}

Request files:

file
The file chunk.

Response (if success):

success
True
upload_id
The id refering to the upload.

/api/v2/upload/complete/

mediaserver.api.v2.views.upload.CompleteResourceUpload(**kwargs)

This url allows to mark an upload by chunks as completed.

Request method: POST

Request args:

[api_key]
See documentation index.
[no_md5]
If “yes”, no md5 sum check will be made.
[md5]
The file md5 sum. Mandatory if the md5 sum check is enabled.
[path]
The relative path to use for the file.

Response (if success):

success
True
upload_id
The id refering to the upload.

/api/v2/upload/hls/

mediaserver.api.v2.views.upload.api_upload_hls(request)

This url allows to upload HLS videos (m3u8 file and ts fragments).

Request method: POST

Request args:

[api_key]
See documentation index.
[service]
The hosting service to use. Default: “local”.
[dir_name]
The directory name in which the files should be added. For example: “myvideo”. If no value is given, a new dir will be created.
hls_name
The name of the HLS video (m3u8 name and fragments dir name). For example: “myhls”.
**
The ts fragments files size and / or the m3u8 file size.

Request files:

**
The ts fragments files and / or the m3u8 file.

Response (if success):

success
True
dir_name
The name of the directory name in which files were added.

Users

/api/v2/users/

mediaserver.api.v2.views.users.users_list(request)

This url returns a list of users. Requires the “can_change_users” permission or the “can_use_permissions_tab” permission (some user fields are hidden in that case).

Request method: GET

Request args:

[api_key]
See documentation index.
[offset]
Start the result list at a given index, similar to SQL offset. Default: 0.
[limit]
Maximum number of results returned. Default: 50. Use 0 to remove limit (the request can be very long and the offset will be ignored).
[order_by]
Order the result list by the given field.
[search]
Search in the result list.
[search_in]
Specify the fields used to do the search.
[search_exact]
Match only fields with the exact value.
[group_id]
Return only users of a given group. Prefix id with a minus sign to exclude user from a given group.

Response (if success):

success
True
users

List of objects with the following fields:

  • api_key
  • company
  • country
  • date_joined
  • email
  • email_validated
  • emails_lang
  • first_name
  • groups
  • id
  • is_active
  • last_backend
  • last_name
  • perms_ignore_auth_grps
  • piu_acceptance_date
  • position
  • receive_credits_level_emails
  • receive_max_viewers_emails
  • receive_subscription_emails
  • receive_support_end_emails
  • shared
  • speaker_id
  • tos_acceptance_date
  • username
  • validation_email_sent

/api/v2/users/get/

mediaserver.api.v2.views.users.users_get(request)

This url returns information about an user. Requires the “can_change_users” permission or the “can_use_permissions_tab” permission (some user fields are hidden in that case).

Request method: GET

Request args:

[api_key]
See documentation index.
id|email
Id or email of user.

Response (if success):

success
True
user

Object with the following fields:

  • api_key
  • company
  • country
  • date_joined
  • email
  • email_validated
  • emails_lang
  • first_name
  • groups
  • id
  • is_active
  • last_backend
  • last_name
  • perms_ignore_auth_grps
  • piu_acceptance_date
  • position
  • receive_credits_level_emails
  • receive_max_viewers_emails
  • receive_subscription_emails
  • receive_support_end_emails
  • shared
  • speaker_id
  • tos_acceptance_date
  • username
  • validation_email_sent

/api/v2/users/add/

mediaserver.api.v2.views.users.users_add(request)

This url allows to add user. By default, the user account will be active. Set “is_active” to “no” to create disabled accounts. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
email
User’s email
[fields]
User’s data: username, password, is_active, emails_lang, company, position, country, street, city, zip_code, first_name, last_name, receive_subscription_emails, receive_support_end_emails, receive_credits_level_emails, receive_max_viewers_emails, speaker_id, shared.

Response (if success):

success
True
msg
Message.
id
New user’s id.
api_key
New user’s API key.

/api/v2/users/edit/

mediaserver.api.v2.views.users.users_edit(request)

This url allows to edit a user settings. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
id|email
Id or email of user to edit.
[fields]
User’s data: username, email, password, is_active, emails_lang, company, position, country, street, city, zip_code, first_name, last_name, receive_subscription_emails, receive_support_end_emails, receive_credits_level_emails, receive_max_viewers_emails, speaker_id, shared.

Response (if success):

success
True
msg
Message.

/api/v2/users/notify/

mediaserver.api.v2.views.users.users_notify(request)

This url allows to notify a user by email to let him know that he has an account. If the user has already used his account, a password reset will be send to him. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
id|email
Id or email of user to notify.

Response (if success):

success
True

/api/v2/users/delete/

mediaserver.api.v2.views.users.users_delete(request)

This url deletes the requested user. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
id|email
Id or email of user.

Response (if success):

success
True

/api/v2/users/import-csv/

mediaserver.api.v2.views.users.users_csv_import(request)

This url allows to import a CSV file to update user accounts in database. Requires the “can_change_users” permission.

Request method: POST

Request args:

[api_key]
See documentation index.
csv_file
The CSV file.
fields_list
The list of the fields names which are in the CSV file. Separate fields names with comas. List of supported fields names: username, email, first_name, last_name, company, position, country, speaker_id, is_active, password, group, groups, notify and ignored. The fields “group” and “groups” can be used several times. The field “notify” should be set to “yes” or “true” to send an email to notify the user that he has an account (only if the user account is active). Use the field “ignored” to ignore a column of the CSV file.
[simulation]
If the simulation is enabled, no changes will be made in database and a full report of changes will be returned. Possible values: “yes” or “no”. Default is “yes”.
[fields_separator]
Fields separator character. Default is “,”.
[groups_separator]
Groups separator character. Default is “;”.
[ignore_first_line]
Ignore first line of the CSV file. Possible values: “yes” or “no”. Default is “yes”.
[encoding]
Encoding of CSV file. Supported encodings: “cp1252” and “utf-8”. Default is “utf-8”.
[alter_all_users]
Allow modification of all users and not only users that were created through another CSV import. Possible values: “yes” or “no”. Default is “no”.
[remove_non_existing_users]
Remove all users who are not in the CSV and who were created through another CSV import. Possible values: “yes” or “no”. Default is “no”.
[remove_empty_groups]
Remove all empty groups who were created through another CSV import. Possible values: “yes” or “no”. Default is “no”.

Response (if success):

success
True