Mediabin REST interface

RESTful API for the MediaBin

MediaBin is a temporary collection of Items (or other entities) that are stored in Portal against a user.

Resource GET /API/v1/mediabin/%id/

Response Formats:
JSON
Resource URL:
/API/v1/mediabin/%id/
Schema URL:
/API/v1/mediabin/schema/
Permission Required:
Authorization

Parameters for MediaBin Item

Name Description Example
id (Integer) GUID for MediaBin object 12
resource_id (String) External resource Identifier such as Vidispine ID VX-1
resource_name (String - optional) Resource identification string. “Item”
resource_uri
(URL)
This MediaBin objects unique relative URL
“/mediabin/12/”
resource_type
(String)
This MediaBin objects type
“video”
thumbnail_uri (URI - optional) Absolute URI to a representative thumbnail for the resource  
ui_selected (Bool - optional) Whether the thumbnail is shown selected in the user interface false
absolute_url (URL - optional) URL to the web page for the item “/vs/item/VX-4/”

Example response:

{
“absolute_url”: “/vs/item/VX-40/”, “id”: “12”, “resource_id”: “VX-40”, “resource_name”: “None”, “resource_uri”: “/API/v1/mediabin/12/”, “thumbnail_uri”: “http://portal.cantemo.com:8080/APInoauth/thumbnail/VX-2/VX-40/ 0?hash=8380e4bf894ec37695a3f0814f81cefb”, “ui_selected”: false

}

Resource GET /API/v1/mediabin/

Returns a list of mediabin items for the user the current authenticated user.

Response Formats:
JSON
Resource URL:
/API/v1/mediabin/
Schema URL:
/API/v1/mediabin/schema/
Permission Required:
Authorization
Name Description Example
limit (Integer) Usual offset limit for pagination 20
next (URI) Next null
offset (Integer) First item on the page 20
previous (URI) Previous null
total (Integer) Total amount of items in the MediaBin for the authenticating user 20

Example response:

{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null,
 "total_count": 1}, "objects": [{"absolute_url": "/vs/item/VX-40/",
 "id": "12", "resource_id": "VX-40", "resource_name": "None",
 "resource_uri": "/API/v1/mediabin/12/",
 "thumbnail_uri": "http://portal.cantemo.com:8080/APInoauth/thumbnail                       /VX-2/VX-40/0?hash=8380e4bf894ec37695a3f0814f81cefb",
 "ui_selected": false}]}

Resource POST /API/v1/mediabin/

When wanting to add an item to the mediabin for the authenticating user.

Example payload:

{"ui_selected":false,"resource_uri":"","absolute_url":"",
 "thumbnail_uri":"http://portal.cantemo.com:8080/APInoauth/thumbnail                     /VX-2/VX-41/0?hash=f7cc4116f9a5c6eb983d5157896f1110",
 "name":"","user":"","resource_id":"VX-41","resource_name":"Infographic"}

Example response (Status Code 200):

{"absolute_url": "/vs/item/VX-41/", "id": "14", "resource_id": "VX-41",
 "resource_name": "Infographic", "resource_uri": "/API/v1/mediabin/14/",
 "thumbnail_uri": "http://portal.cantemo.com:8080/APInoauth/thumbnail/                       VX-2/VX-41/0?hash=f7cc4116f9a5c6eb983d5157896f1110",
 "ui_selected": false, "resource_type": "video"}
class portal.mediabin.api.MediaBinResource(api_name=None)
authorized_read_list(object_list, bundle)

Limit this to authenticated users…

obj_create(bundle, request=None, **kwargs)

A ORM-specific implementation of obj_create.

post_list(request, **kwargs)

Custom method to return what has been created from the POST response