Table of Contents

In the same category

Complete API

Root

Root is the entry point of Libcast web services discovery and exploration. It lists all services the user can connect and use (usually his files and accesses to publication tree).

Request:

GET / HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<services>
  <media href="https://api.libcast.com/media/eagle-tv">
  <files href="https://api.libcast.com/files" />
</services>

Platform

A platform is described by the following properties:

  • slug: automatically generated from the name (UNIQUE)
  • name: a 255 variable length string (REQUIRED)
  • max_users: 0 means unlimited (REQUIRED)
  • max_space: (in bytes) 0 means unlimited (REQUIRED)

Platform list

Request:

GET /platforms HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<platforms>
  <platform href="https://api.libcast.com/platform/birds">
    <slug>birds</slug>
    <name>Birds</name>
    <max_users>100</max_users>
    <max_space>5000</max_space>
  </platform>
  <platform href="https://api.libcast.com/platform/cyprus-soccer">
    <slug>cyprus-soccer</slug>
    <name>Cyprus Soccer Online</name>
    <max_users>120</max_users>
    <max_space>2000</max_space>
  </platform>
</platforms>

Platform info

Request:

GET /platform/birds HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<platform href="https://api.libcast.com/platform/birds">
  <slug>birds</slug>
  <name>>Birds</name>
  <max_users>100</max_users>
  <created_users>7</created_users>
  <max_space>5000</max_space>
  <used_space>4127</used_space>
  <metadata href="https://api.libcast.com/platform/birds/metadata">
</platform>

Platform create

Request:

POST /platforms HTTP/1.0
name: Eagle TV
max_users: 100
max_space: 5000

Response:

HTTP/1.0 201 Created

Platform update

Request:

PUT /platform/birds HTTP/1.0
name: Birds
max_users: 100
max_space: 0

Response:

HTTP/1.0 200 OK

Platform delete

Request:

DELETE /platform/birds HTTP/1.0

Response:

HTTP/1.0 204 No Content

Media

A media is described by the following properties:

  • slug: automatically generated from the name (UNIQUE)
  • name: a 255 variable length string (REQUIRED)
  • platform: a valid platform slug (REQUIRED)
  • domain: a 255 variable length string (e.g.: www.mywebtv.com) (REQUIRED)
  • description: in any simple text format (including plain text and HTML)
  • contact_email: administrative contact email for the media (REQUIRED)
  • max_streams: 0 means unlimited

Media list

Request:

GET /platform/birds/medias HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<medias>
  <media href="https://api.libcast.com/media/eagle-tv">
    <slug>eagle-tv</slug>
    <name>Eagle TV</name>
    <domain>eagle.tv</domain>
    <description>The greatest movies and documentaries about eagles.</description>
    <contact_email>max@eagle.tv</contact_email>
    <max_streams>0</max_streams>
  </media>
  <media href="https://api.libcast.com/media/birds-blogers">
    <slug>birds-blogers</slug>
    <name>Birds blogers</name>
    <domain>blogs.birds.com</domain>
    <description>Blogs for fan of birds.</description>
    <contact_email>john@birds.com</contact_email>
    <max_streams>0</max_streams>
  </media>
</medias>

Media create

Request:

POST /platform/birds/medias HTTP/1.0
name: Eagle TV
domain_name: eagle.tv
description: The greatest movies and documentaries about eagles.
domain: eagle.tv
contact_email:max@eagle.tv
max_streams: 0

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<media href="https://api.libcast.com/media/eagle-tv">
  <slug>eagle-tv</slug>
  <name>Eagle TV</name>
  <domain_name>eagle.tv</domain_name>
  <description>The greatest movies and documentaries about eagles.</description>
  <contact_email>max@eagle.tv</contact_email>
  <max_streams>0</max_streams>
  <platform href="https://api.libcast.com/platform/birds" />
  <streams href="https://api.libcast.com/media/eagle-tv/streams"/>
  <channels href="https://api.libcast.com/media/eagle-tv/channels"/>
</media>

Media info

Request:

GET /media/eagle-tv HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<media href="https://api.libcast.com/media/eagle-tv">
  <slug>eagle-tv</slug>
  <name>Eagle TV</name>
  <domain_name>eagle.tv</domain>
  <description>The greatest movies and daocumentaries about eagles.</description>
  <contact_email>max@eagle.tv</contact_email>
  <max_streams>0</max_streams>
  <platform href="https://api.libcast.com/platform/birds" />
  <channels href="https://api.libcast.com/media/eagle-tv/channels"/>
</media>

Media update

Request:

PUT /media/eagle-tv HTTP/1.0
contact_email: michael@eagle.tv

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<media href="https://api.libcast.com/media/eagle-tv">
  <slug>eagle-tv</slug>
  <name>Eagle TV</name>
  <platform href="https://api.libcast.com/platform/birds" />
  <domain_name>eagle.tv</domain_name>
  <description>The greatest movies and documentaries about eagles.</description>
  <contact_email>michael@eagle.tv</contact_email>
  <max_streams>0</max_streams>
  <channels href="https://api.libcast.com/media/eagle-tv/channels"/>
</media>

Media delete

Request:

DELETE /media/eagle-tv HTTP/1.0

Response:

HTTP/1.0 204 No Content

Stream

A stream is described by the following properties:

  • slug: automatically generated from the title (UNIQUE)
  • parent_stream: parent stream slug (OPTIONAL)
  • title: a 255 variable length string (REQUIRED)
  • sub_title: a 255 variable length string
  • media: a valid media slug (REQUIRED)
  • description: in any simple text format (including plain text and HTML)
  • visibility: visible, hidden or draft (REQUIRED)

Stream list

Request:

GET /media/birds-blogers/streams HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<streams>
  <stream href="https://api.libcast.com/stream/nest-pictures">
    <slug>nest-pictures</slug>
    <title>Nest pictures !!!</title>
    <sub_title>One picture of nests around my house each day</sub_title>
    <media href="https://api.libcast.com/media/birds-blogers" />
    <description>I like to take pictures of the nests around my house and share them with the Internet comm
  </stream>
  <stream href="https://api.libcast.com/stream/chicken">
    <slug>chicken-blogs</slug>
    <title>Chicken blogs</title>
    <sub_title>A place for chicken related blogs</sub_title>
    <media href="https://api.libcast.com/media/birds-blogers" />
    <description>Create a blog here in 3 minutes if you want to blog about chicken.</description>
  </stream>
  <stream href="https://api.libcast.com/stream/diabolo">
    <slug>diabolo-chick</slug>
    <title>Diabolo chick</title>
    <sub_title>Here is my little chick: Diabolo !</sub_title>
    <media href="https://api.libcast.com/media/birds-blogers" />
    <description>Here is my little chick: Diabolo !</description>
  </stream>
</streams>

Stream info

Request:

GET /stream/nest-pictures HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<stream href="https://api.libcast.com/stream/nest-pictures">
  <slug>nest-pictures</slug>
  <parent_stream></parent_stream>
  <title>Nest pictures !!!</title>
  <subtitle>One picture of nests around my house each day</subtitle>
  <media href="https://api.libcast.com/media/birds-blogers" />
  <description>I like to take pictures of the nests around my house and share them with the Internet communit
  <visibilityll>visible</visibility>
</stream>

Stream create

Request:

POST /media/birds-blogers/streams HTTP/1.0
title: Nest pictures !!!
subtitle: One picture of nests around my house each day
description: I like to take pictures of the nests around my house and share them with the Internet community.
visibility: visible

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<stream href="https://api.libcast.com/stream/nest-pictures">
  <slug>nest-pictures</slug>
  <parent_stream></parent_stream>
  <title>Nest pictures !!!</title>
  <subtitle>One picture of nests around my house each day</subtitle>
  <media href="https://api.libcast.com/media/birds-blogers" />
  <description>I like to take pictures of the nests around my house and share them with the Internet communit
  <visibilityll>visible</visibility>
</stream>

Stream update

Request:

PUT /stream/nest-pictures HTTP/1.0
title: Nest pictures !!!
subtitle: One picture of nests around my house each day
description: I like to take pictures of the nests around my house and share them with the Internet community.
visibility: hidden

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<stream href="https://api.libcast.com/stream/nest-pictures">
  <slug>nest-pictures</slug>
  <parent_stream></parent_stream>
  <title>Nest pictures !!!</title>
  <subtitle>One picture of nests around my house each day</subtitle>
  <media href="https://api.libcast.com/media/birds-blogers" />
  <description>I like to take pictures of the nests around my house and share them with the Internet communit
  <visibilityll>hidden</visibility>
</stream>

Stream delete

Request:

DELETE /stream/nest-pictures HTTP/1.0

Response:

HTTP/1.0 204 No Content

Directory

A directory is described simply by its name:

  • slug: automatically generated from the name (UNIQUE)
  • name: a 255 variable length string (REQUIRED)

There is no directory list service since each user has a single root directory and directory browsing involves only one directory at a time.

/files is the root directory of the connected user.

Directory info

Request:

GET /files/records HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<directory href="https://api.libcast.com/files/records">
  <name><![CDATA[Records]]></name>
  <directory rel="parent" href="https://api.libcast.com/files"/>
</directory>

Directory create

Request:

POST /files/records HTTP/1.0
name: HD

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<directory href="https://api.libcast.com/files/hd">
  <name><![CDATA[HD]]></name>
  <directory rel="parent" href="https://api.libcast.com/files/records"/>
</directory>

Directory update

Request:

PUT /files/hd HTTP/1.0
name: HD (1080p & 720p)

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<directory href="https://api.libcast.com/files/hd">
  <name><![CDATA[HD (1080p & 720p)]]></name>
  <directory rel="parent" href="https://api.libcast.com/files/records"/>
</directory>

Directory delete

Request:

DELETE /files/ld HTTP/1.0

Responses:

HTTP/1.0 204 No Content

This service allows searching directories against their name (part or full).

Request:

GET /search/directories?name=definition HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<directories>
  <directory href="https://api.libcast.com/files/definitions">
    <name>
      <![CDATA[ Definitions ]]>
    </name>
  </directory>
  <directory href="https://api.libcast.com/files/high-definition">
    <name>
      <![CDATA[ High Definition ]]>
    </name>
  </directory>
  <directory href="https://api.libcast.com/files/low-definition">
    <name>
      <![CDATA[ Low Definition ]]>
    </name>
  </directory>
</directories>

Request:

GET /search/directories?name=High%20Definition HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<directories>
  <directory href="https://api.libcast.com/files/high-definition">
    <name>
      <![CDATA[ High Definition ]]>
    </name>
  </directory>
</directories>

File

A file is described by the following properties:

  • slug: automatically generated from the name (UNIQUE)
  • user: a valid owner username (REQUIRED)
  • name: a 255 variable length string (REQUIRED)
  • size: in bytes
  • encoding_status: pending waiting running success failed finished
  • directory: link to the directory containing the file

File list

Request:

GET /files/swallows HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<files href="https://api.libcast.com/files/swallows">
  <name>Swallows</name>
  <directory rel="parent" href="https://api.libcast.com/files" />
  <file href="https://api.libcast.com/file/swallows-5-mov">
    <slug>swallows-5-mov</slug>
    <size>134057</size>
    <encoding_status>1</encoding_status>
    <thumbnail>https://api.libcast.com/file/swallows-5-mov/thumbnail</thumbnail>
  </file>
  [..]
</files>

The root directory is located at /files for the user connected to the API. There is no way to access the files of another user.

File info

The file info service contains a URL encoded embed code to preview the file. The embed expires at the end of each client session, it has to be retrieved once during each session. Otherwise, it is recommended to cache the thumbnail if you want to use it later.

Request:

GET /file/swallows-5-mov HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<file href="https://api.libcast.com/file/swallows-5-mov">
  <slug>swallows-5-mov</slug>
  <name>Swallows 5.mov</name>
  <size>134057</size>
  <type>video</type>
  <encoding_status>running</encoding_status>
  <encoding_progress>22</encoding_progress>
  <user rel="owner" href="https://api.libcast.com/users/me" />
  <thumbnail>https://api.libcast.com/file/swallows-5-mov/thumbnail</thumbnail>
  <directory rel="parent" href="https://api.libcast.com/files/swallows" />
  <embed><![CDATA[...]]></embed>
  <metadata>
    <photographer>Luc Philips</photographer>
    <year>1994</year>
    <archive_category>Birds</archive_category>
  </metadata>
</file>

File encoding status

The file encoding status is a simplified view of the file info service. The following properties are displayed:

  • encoding_status
  • encoding_progress

Request:

GET /file/swallows-5-mov/status HTTP/1.0

Response (encoding in progress):

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<file href="https://api.libcast.com/file/swallows-5-mov">
  <encoding_status>success</encoding_status>
  <encoding_progress>22</encoding_progress>
</file>

Response (encoding finished):

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<file href="https://api.libcast.com/file/swallows-5-mov">
  <encoding_status>finished</encoding_status>
  <encoding_progress>100</encoding_progress>
</file>

File create

File creation requires a physical file upload, which is not supported by REST by design. Libcast uses the most common practices to handle this task.

The POST optional parameters chunks and chunk may be used to send one single file through multiple pieces (mandatory for files up to 64Mo !). There must be as many request as the number of pieces. The chunks parameter indicated the total number of pieces. The chunk parameter indicates which piece is being sent (starting with 0).

You can upload to the root directory (/files) or directly to another directory (/files/hd for example);

Request:

POST /files HTTP/1.0
chunks: 10 (OPTIONAL)
chunk: 0 (OPTIONAL)
Content-Type: multipart/form-data; path="Swallows 5.mov"; boundary=----------------------------9add31cf2d64

6FRCtipZkwPS+BOe460IstebLyjkF7sZ0ZT0vmq9PeIj9ZMsF+/RNkusQb/w7PmvuTBXVj9Xc0DdN2+BlixAf
[..]
-----------------------------9add31cf2d64

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<file href="https://api.libcast.com/file/swallows-5-mov">
  <slug>swallows-5-mov</slug>
  <name>Swallows 5.mov</name>
  <type>video</type>
  <size>134057</size>
  <encoding_status>0</encoding_status>
  <user rel="owner" href="https://api.libcast.com/users/me" />
  <thumbnail>https://api.libcast.com/file/swallows-5-mov/thumbnail</thumbnail>
  <embed><![CDATA[..]]></embed>
  <directory rel="parent" href="https://api.libcast.com/files/swallows" />
</file>

At this time, files can only be uploaded to the root directory.

If the upload is chunked, only the last chunk upload response will be a valid REST response. At this time each intermediate chunk upload response will be a JSON serialized answer.

File upload from an external form

This service provides a temporary URL allowing file uploads from a form hosted on an external server. This URL is intended to be the action of the form. The response has two variations of the URL, matching the desired response format: ‘html’ or ‘json’. It means when you upload the form, you can choose if you want a json response or a html response.

Building the service location

A file upload is tied to a folder. The service location reflects this dependency.

For the root folder, just get the root location URL: /files

And append the suffix ‘/upload_links’:

/files/upload_links

For another folder, get the location URL or this folder:

/files/my-directory

And append the suffix ‘/upload_links’:

/files/my-directory/upload_links

Requesting the service

This service is available with POST method only.

Requesting the service for the root directory:

Request:

POST /files/upload_links HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<links>
  <link rel="html" href="http://console.libcast.com/file/upload/root-for-user-my-user.html?lc_token=603fcb29b370c75e0cd1d3cacf8b1ee7db4cb000"/>
  <link rel="json" href="http://console.libcast.com/file/upload/root-for-user-my-user.json?lc_token=603fcb29b370c75e0cd1d3cacf8b1ee7db4cb000"/>
</links>

Requesting the service for “my-directory” directory:

Request:

POST /files/my-directory/upload_links HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<links>
  <link rel="html" href="http://console.libcast.com/file/upload/my-directory.html?lc_token=603fcb29b370c75e0cd1d3cacf8b1ee7db4cb000"/>
  <link rel="json" href="http://console.libcast.com/file/upload/my-directory.json?lc_token=603fcb29b370c75e0cd1d3cacf8b1ee7db4cb000"/>
</links>

Using the generated upload URL

In order to set up the uploading form, some conditions are required. See the Usage documentation for a full example and adapt it to your convenience.

File update

File update is permitted to change file properties and metadata.

Request:

PUT /file/swallows-5-mov HTTP/1.0
name: Swallows (Connecticut)
metadata[place]: Connecticut

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<file href="https://api.libcast.com/file/swallows-5-mov">
  <slug>swallows-5-mov</slug>
  <name>Swallows (Connecticut)</name>
  <type>video</type>
  <size>134057</size>
  <encoding_status>0</encoding_status>
  <user rel="owner" href="https://api.libcast.com/users/me" />
  <thumbnail>https://api.libcast.com/file/swallows-5-mov/thumbnail</thumbnail>
  <embed><![CDATA[..]]></embed>
  <directory rel="parent" href="https://api.libcast.com/files/swallows" />
  <metadata>
    <place>Connecticut</place>
  </metadata>
</file>

List File snapshots

Lists all available snapshots for a given File.

Request:

GET /file/swallows-5-mov/snapshots HTTP/1.0

Response:

HTTP/1.0 202 Accepted
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<snapshots>
    <snapshot id="0" src="https://api.libcast.com/file/123/snapshot/idx/0/file.jpg"/>
    <snapshot id="1" src="https://api.libcast.com/file/123/snapshot/idx/1/file.jpg"/>
    <snapshot id="2" src="https://api.libcast.com/file/123/snapshot/idx/2/file.jpg"/>
    <snapshot id="3" src="https://api.libcast.com/file/123/snapshot/idx/3/file.jpg"/>
    <snapshot id="4" src="https://api.libcast.com/file/123/snapshot/idx/4/file.jpg"/>
    <snapshot id="5" src="https://api.libcast.com/file/123/snapshot/idx/5/file.jpg"/>
    <snapshot id="6" src="https://api.libcast.com/file/123/snapshot/idx/6/file.jpg"/>
    <snapshot id="7" src="https://api.libcast.com/file/123/snapshot/idx/7/file.jpg"/>
    <snapshot id="8" src="https://api.libcast.com/file/123/snapshot/idx/8/file.jpg"/>
    <snapshot id="9" src="https://api.libcast.com/file/123/snapshot/idx/9/file.jpg"/>
    <snapshot id="10" src="https://api.libcast.com/file/123/snapshot/idx/10/file.jpg"/>
    <snapshot id="11" src="https://api.libcast.com/file/123/snapshot/idx/11/file.jpg"/>
</snapshots>

Select an existing File snapshots

Selects a snapshot from the list of those generated by the transcoding servers.

Request:

POST /file/swallows-5-mov/snapshots HTTP/1.0
id: 3

Response:

HTTP/1.0 200 OK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<snapshots>
    <snapshot id="0" src="https://api.libcast.com/file/123/snapshot/idx/0/file.jpg"/>
    <snapshot id="1" src="https://api.libcast.com/file/123/snapshot/idx/1/file.jpg"/>
    <snapshot id="2" src="https://api.libcast.com/file/123/snapshot/idx/2/file.jpg"/>
    <snapshot id="3" src="https://api.libcast.com/file/123/snapshot/idx/3/file.jpg" selected="true"/>
    <snapshot id="4" src="https://api.libcast.com/file/123/snapshot/idx/4/file.jpg"/>
    <snapshot id="5" src="https://api.libcast.com/file/123/snapshot/idx/5/file.jpg"/>
    <snapshot id="6" src="https://api.libcast.com/file/123/snapshot/idx/6/file.jpg"/>
    <snapshot id="7" src="https://api.libcast.com/file/123/snapshot/idx/7/file.jpg"/>
    <snapshot id="8" src="https://api.libcast.com/file/123/snapshot/idx/8/file.jpg"/>
    <snapshot id="9" src="https://api.libcast.com/file/123/snapshot/idx/9/file.jpg"/>
    <snapshot id="10" src="https://api.libcast.com/file/123/snapshot/idx/10/file.jpg"/>
    <snapshot id="11" src="https://api.libcast.com/file/123/snapshot/idx/11/file.jpg"/>
</snapshots>

Upload and select a File snapshots

Uploads and selects an image as a new snapshot for a File.

Request:

POST /file/swallows-5-mov/snapshots HTTP/1.0
Content-Type: multipart/form-data; file_upload="Video-snap.jpg"; boundary=----------------------------8xxd53bh91z9

6FRCtipZkwPS+BOe460IstebLyjkF7sZ0ZT0vmq9PeIj9ZMsF+/RNkusQb/w7PmvuTBXVj9Xc0DdN2+BlixAf
[..]
-----------------------------8xxd53bh91z9

Response:

HTTP/1.0 200 OK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<snapshots>
    <snapshot id="0" src="https://api.libcast.com/file/123/snapshot/idx/0/file.jpg"/>
    <snapshot id="1" src="https://api.libcast.com/file/123/snapshot/idx/1/file.jpg"/>
    <snapshot id="2" src="https://api.libcast.com/file/123/snapshot/idx/2/file.jpg"/>
    <snapshot id="3" src="https://api.libcast.com/file/123/snapshot/idx/3/file.jpg"/>
    <snapshot id="4" src="https://api.libcast.com/file/123/snapshot/idx/4/file.jpg"/>
    <snapshot id="5" src="https://api.libcast.com/file/123/snapshot/idx/5/file.jpg"/>
    <snapshot id="6" src="https://api.libcast.com/file/123/snapshot/idx/6/file.jpg"/>
    <snapshot id="7" src="https://api.libcast.com/file/123/snapshot/idx/7/file.jpg"/>
    <snapshot id="8" src="https://api.libcast.com/file/123/snapshot/idx/8/file.jpg"/>
    <snapshot id="9" src="https://api.libcast.com/file/123/snapshot/idx/9/file.jpg"/>
    <snapshot id="10" src="https://api.libcast.com/file/123/snapshot/idx/10/file.jpg"/>
    <snapshot id="11" src="https://api.libcast.com/file/123/snapshot/idx/11/file.jpg"/>
    <snapshot id="custom" src="https://api.libcast.com/file/123/thumbnail/thumb.jpg" selected="true"/>
</snapshots>

Inserts a registered logo into the video. This method creates a new File (original is kept unchanged). The method takes a logo slug as parameter together with width, height, top and left position expressed in percentage (without the %). A name should also be provided, it will be used to name the new File.

The name (not the slug) of the new File is returned in the response body.

Request:

POST /file/swallows-5-mov/studio/insertlogo HTTP/1.0
logo: bird-corp-logo
logo_width: 20
logo_height: 22
logo_top: 70
logo_left: 73
name: Swallows (Connecticut) with a logo

Response:

HTTP/1.0 202 Accepted
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<file>
    <type>video</type>
    <encoding_status>pending</encoding_status>
    <directory rel="parent" href="https://api.libcast.com/files"/>
    <name><![CDATA[swallows-connecticut-with-a-logo_1444741034_logo.mp4]]></name>
</file>

File delete

Deleting a file deletes also all the resources created from this file.

Request:

DELETE /file/swallows-5-mov HTTP/1.0

Response:

HTTP/1.0 204 No Content

Resource

A resource is described by the following properties:

  • slug: automatically generated from the title (UNIQUE)
  • file: a valid file slug (REQUIRED)
  • stream: a valid stream slug (REQUIRED)
  • title: a 255 variable length string (REQUIRED)
  • sub_title: a 255 variable length string
  • published_at: universal date-time (ISO 8601)
  • visibility: visible, hidden or draft (REQUIRED)

Resource list

Request:

GET /stream/nest-pictures/resources HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<resources>
  <resource href="https://api.libcast.com/resource/little-swallows-4-weeks">
    <slug>little-swallows-4-weeks</slug>
    <title>Little swallows (4 weeks)</title>
    <sub_title>There is a fourth little swallow I didn't notive before !</sub_title>
    <published_at>2010-07-16T19:20:30.45+01:00</published_at>
    <visibility>visible</visibility>
  </resource>
  [..]
</resources>

Resource info

This method returns deliverable elements such as player URLs, widget embeds or flavor URLs depending on which publication channel has been activated upon the Media.

Request:

GET /resource/little-swallows-4-weeks HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<resource href="https://api.libcast.com/resource/little-swallows-4-weeks">
  <slug>little-swallows-4-weeks</slug>
  <title>Little swallows (4 weeks)</title>
  <subtitle>There is a fourth little swallow I didn't notive before !</subtitle>
  <published_at>2010-07-16T19:20:30.45+01:00</published_at>
  <visibility>visible</visibility>
  <duration>340</duration>
  <views>123</views>
  <thumbnail>https://api.libcast.com/file/swallows-5-mov/thumbnail</thumbnail>
  <file href="https://api.libcast.com/file/swallows-5-mov" />
  <stream href="https://api.libcast.com/stream/nest-pictures" />
  <accesses href="https://api.libcast.com/resource/resource-test-tse/accesses"/>
  <flavors>
    <flavor name="hd-for-html5-player"><![CDATA[..]]></player>
    <flavor name="ld-for-html5-player"><![CDATA[..]]></player>
  </flavors>
  <players>
    <player name="web-tv"><![CDATA[..]]></player>
  </players>
  <widgets href="https://api.libcast.com/resource/resource-test-tse/widgets?sf_subject%5Buser_is_modified%5D=1&amp;sf_subject%5BisInsert%5D=0">
    <widget name="national-geographic-website"><![CDATA[..]]></widget>
  </widgets>
  <metadata>
    <photographer>Luc Philips</photographer>
    <year>1994</year>
    <archive_category>Birds</archive_category>
  </metadata>
</resource>

Resource create

Resource creation is an alias for file publication. Request:

POST /stream/nest-pictures/resources HTTP/1.0
file: swallows-5-mov
title: Little swallows (4 weeks)
subtitle: There is a fourth little swallow I didn't notive before !
published_at: 2010-07-16T19:20:30.45+01:00
visibility: visible

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<resource /resource/little-swallows-4-weeks">
  <slug>little-swallows-4-weeks</slug>
  <title>Little swallows (4 weeks)</title>
  <subtitle>There is a fourth little swallow I didn't notive before !</subtitle>
  <published_at>2010-07-16T19:20:30.45+01:00</published_at>
  <visibility>visible</visibility>
  <file href="https://api.libcast.com/file/swallows-5-mov" />
  <stream href="https://api.libcast.com/stream/nest-pictures" />
</resource>

Resource update

Request:

PUT /resource/little-swallows-4-weeks HTTP/1.0
file: swallows-5-mov
title: Little swallows (4 weeks)
subtitle: There is a fourth little swallow I didn't notice before !
published_at: 2010-07-16T19:20:30.45+01:00
metadata[photographer]: Luc Philips
metadata[year]: 1994
metadata[archive_category]: Birds

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<resource href="https://api.libcast.com/resource/little-swallows-4-weeks">
  <slug>little-swallows-4-weeks</slug>
  <file href="https://api.libcast.com/file/swallows-5-mov" />
  <stream href="https://api.libcast.com/stream/nest-pictures" />
  <title>Little swallows (4 weeks)</title>
  <subtitle>There is a fourth little swallow I didn't notice before !</subtitle>
  <published_at>2010-07-16T19:20:30.45+01:00</published_at>
  <visibilityll>visible</visibility>
  <metadata>
    <photographer>Luc Philips</photographer>
    <year>1994</year>
    <archive_category>Birds</archive_category>
  </metadata>
</resource>

Resource delete

Request:

DELETE /resource/little-swallows-4-weeks HTTP/1.0

Responses:

HTTP/1.0 204 No Content

Subtitles

You can upload subtitles to your videos and richmedia which the player will load when playing them. Each subtitle require a subtitle file (only SRT and WebVTT formats are supported at the time) and a language code (a valid ISO 639-1 2-letters code).

Adding and removing subtitles can be done on File model, while Resource model will show downloadable/playable URL for each subtitle.

Add subtitles

Request:

POST https://api.libcast.com/file/pelican-flying-6/subtitles HTTP/1.0
language: es
Content-Type: multipart/form-data; subtitle="Pelican-flying (espanol).srt"; boundary=----------------------------9add31cf2d64

Response:

HTTP/1.0 201 Created
Content-Type: application/vnd.libcast+xml
<?xml version="1.0" charset="UTF-8" ?>
<file href="https://api.libcast.com/file/pelican-flying-6">
  <slug>pelican-flying-6</slug>
  <name>Pelican flying</name>
  <size>29398743</size>
  <encoding_status>1</encoding_status>
  <user rel="owner" href="https://api.libcast.com/users/john" />
  <thumbnail>https://api.libcast.com/file/pelican-flying-6/thumbnail</thumbnail>
  <embed><![CDATA[..]]></embed>
  <directory rel="parent" href="https://api.libcast.com/files/pelicans" />
  <subtitles>
    <subtitle language="es" href="https://api.libcast.com/file/pelican-flying-6/subtitles/fb6900fce36a06a9923f62c7cd01ab43da63d19e.es.srt" />
  </subtitles>
</file>

Response status: 201, 401, 403, 404, 412, 500

List subtitles

You just have to call the file info service to obtain the list of subtitles, each with an API URL to remove them.

You can also call resource info to obtain the same list with a twist: the URL is a downloadable/usable one. You call use the subtitle from anywhere.

Remove subtitles

You must use the href attribute of the file info service to remove subtitles.

Request:

DELETE https://api.libcast.com/file/pelican-flying-6/subtitles/fb6900fce36a06a9923f62c7cd01ab43da63d19e.es.srt HTTP/1.0

Response:

HTTP/1.0 204 No Content

Widget

A widget is described by the following properties:

  • slug: automatically generated from the name (UNIQUE)
  • name: a name (REQUIRED)
  • size: size of the player at WIDTHxHEIGHT format, eg. “480x360” (REQUIRED)
  • player_theme: a valid player theme slug
  • player_behavior: a valid player theme behavior

Widget list

Request:

GET /resource/little-swallows-4-weeks/widgets HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<widgets>
  <widget href="https://api.libcast.com/resource/little-swallows-4-weeks/widgets/national-geographic-website">
    <slug>national-geographic-website</slug>
    <name>National Geographic website</title>
    <size>480x360</size>
    <thumbnail>https://api.libcast.com/file/swallows-5-mov/thumbnail</thumbnail>
  </widget>
  [..]
</widgets>

Widget info

The widget info service contains URL encoded embeds code to view the widget. Unlike the file one, this embed code is permanent and can be embed definitively in frontend HTML pages.

Request:

GET /resource/little-swallows-4-weeks/widgets/national-geographic-website HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<widget href="https://api.libcast.com/resource/little-swallows-4-weeks/widgets/national-geographic-website">
  <slug><![CDATA[national-geographic-website]]></slug>
  <name><![CDATA[National Geographic website]]></name>
  <size>480x360</size>
  <thumbnail><![CDATA[https://api.libcast.com/file/swallows-5-mov/thumbnail]]></thumbnail>
  <embeds>
    <iframe><![CDATA[...]]></iframe>
    <javascript><![CDATA[...]]></javascript>
  </embeds>
  <player_theme href="https://api.libcast.com/platform/birds/player_theme/national-geo-colors"/>
  <player_theme href="https://api.libcast.com/platform/birds/player_theme/autoplay-with-ad"/>
</widget>

Widget create

Widget creation must be performed from a resource. That’s why the URL to access widget create method contains the corresponding resource’s slug.

Request:

POST /resource/little-swallows-4-weeks/widgets HTTP/1.0
name: National Geographic website
size: 480x360
player_theme: national-geo-colors
player_behavior: autoplay-with-ad

Response:

HTTP/1.0 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<widget href="https://api.libcast.com/resource/little-swallows-4-weeks/widgets/national-geographic-website">
  <slug><![CDATA[national-geographic-website]]></slug>
  <name><![CDATA[National Geographic website]]></name>
  <size>480x360</size>
  <thumbnail><![CDATA[https://api.libcast.com/file/swallows-5-mov/thumbnail]]></thumbnail>
  <embeds>
    <iframe><![CDATA[...]]></iframe>
    <javascript><![CDATA[...]]></javascript>
  </embeds>
  <player_theme href="https://api.libcast.com/platform/birds/player_theme/national-geo-colors"/>
  <player_theme href="https://api.libcast.com/platform/birds/player_theme/autoplay-with-ad"/>
</widget>

Widget update

Request:

PUT /resource/little-swallows-4-weeks/widgets/national-geographic-website HTTP/1.0
name: National Geo portal
size: 320x240

Response:

HTTP/1.0 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<widget href="https://api.libcast.com/resource/little-swallows-4-weeks/widgets/national-geographic-website">
  <slug><![CDATA[national-geographic-website]]></slug>
  <name><![CDATA[National Geo portal]]></name>
  <size>320x240</size>
  <thumbnail><![CDATA[https://api.libcast.com/file/swallows-5-mov/thumbnail]]></thumbnail>
  <embeds>
    <iframe><![CDATA[...]]></iframe>
    <javascript><![CDATA[...]]></javascript>
  </embeds>
  <player_theme href="https://api.libcast.com/platform/birds/player_theme/national-geo-colors"/>
  <player_theme href="https://api.libcast.com/platform/birds/player_theme/autoplay-with-ad"/>
</widget>

Widget delete

Request:

DELETE /resource/little-swallows-4-weeks/widgets/national-geographic-website HTTP/1.0

Responses:

HTTP/1.0 204 No Content

Player theme, player behavior

Player’s themes and behaviors are related to a platform.

List

Request:

GET /platform/birds/player_theme HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<player_themes>
  <player_theme href="https://api.libcast.com/platform/birds/player_theme/national-geo-colors">
    <name>National Geographic colors</title>
  </player_theme>
  [..]
</player_themes>

Request:

GET /platform/birds/player_behavior HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<player_behaviors>
  <player_behavior href="https://api.libcast.com/platform/birds/player_behavior/autoplay-with-ad">
    <name>Autoplay with Ad</title>
  </player_behavior>
  [..]
</player_behaviors>

Info

Request:

GET /platform/birds/player_theme/national-geo-colors HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<player_theme>
  <name>National Geographic colors</title>
  <slug>national-geo-colors</slug>
</player_theme>

Request:

GET /platform/birds/player_behavior/autoplay-with-ad HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<player_behavior>
  <name>Autoplay with Ad</title>
  <slug>autoplay-with-ad</slug>
</player_behavior>

Metadata

Metadata can be declared on the platform level and set on files and resources. The metadata set on a file are inherited by the resources published from this file. Th metadata on a resource inherited from its file can be overridden at the resource level.

A metadatum is defined by the following properties:

  • name: name of the metadatum, a 255 variable length string (REQUIRED)
  • type: type of the metadatum, one of varchar, longvarchar, integer, bigint, date, boolean or choice (REQUIRED)
  • file_type: the file types to which the metadum applies, one or many (comma separated) of varchar, longvarchar, integer, bigint, date, boolean or choice (REQUIRED)
  • is_protected: whether the metadatum set on the file can be overridden on the the resource level or not, boolean
  • default_value: the default value of string or integer metadata, or the list of available options for a choice metadatum

Metadata list

Request:

GET /platform/birds/metadata HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<metadata>
  <metadata href="https://api.libcast.com/metadata/photographer">
    <name>Photographer</name>
    <type>choice</type>
    <file_type>image,video</file_type>
    <is_protected>false</is_protected>
    <default_value>Bill,Alice,John,Sandra</default_value>
  </metadata>
  <metadata href="https://api.libcast.com/metadata/year">
    <name>Year of creation</name>
    <type>integer</type>
    <file_type>image,video,document</file_type>
    <is_protected>false</is_protected>
    <default_value></default_value>
  </metadata>
  [..]
</metadata>

Metadata info

Request:

GET /metadata/photographer HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<metadata href="https://api.libcast.com/metadata/photographer">
  <name>Photographer</name>
  <type>choice</type>
  <file_type>image,video</file_type>
  <is_protected>false</is_protected>
  <default_value>Bill,Alice,John,Sandra</default_value>
</metadata>

Metadata create

Request:

POST /platform/birds/metadata HTTP/1.0
name: Photographer
username: johnsmith
type: choice
file_type: image,video
is_protected: false
default_value: Bill,Alice,John,Sandra

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<metadata href="https://api.libcast.com/metadata/photographer">
  <name>Photographer</name>
  <type>choice</type>
  <file_type>image,video</file_type>
  <is_protected>false</is_protected>
  <default_value>Bill,Alice,John,Sandra</default_value>
  <platform href="https://api.libcast.com/platform/birds" />
</metadata>

Metadata update

Request:

PUT /metadata/photographer HTTP/1.0
is_protected: true

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<metadata href="https://api.libcast.com/metadata/photographer">
  <name>Photographer</name>
  <type>choice</type>
  <file_type>image,video</file_type>
  <is_protected>true</is_protected>
  <default_value>Bill,Alice,John,Sandra</default_value>
  <platform href="https://api.libcast.com/platform/birds" />
</metadata>

Metadata delete

Request:

DELETE /metadata/photographer HTTP/1.0

Response:

HTTP/1.0 204 No Content

User

Users are attached to a platform. A user is described by the following properties:

  • username: unique user identifier across the platform - max 128 characters (UNIQUE)
  • platform: valid platform slug (REQUIRED)
  • profile: valid profile slug (REQUIRED)
  • first_name: a 255 variable length string
  • last_name: a 255 variable length string
  • password: max 128 characters (REQUIRED)
  • email: a 255 variable length string unique across the platform (REQUIRED)
  • telephone: a 20 variable length string
  • address: a 255 variable length string
  • city: a 100 variable length string
  • zipcode: a 5 chars string
  • country: a ISO 3166-1 alpha-2 code (uppercase required)
  • language: a ISO 639-1 alpha-2 code (lowercase required)
  • is_active: 0 1 (default: 1) if his account is inactive, a user cannot login to the server

User list

Request:

GET /platform/birds/users HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<users>
  <user href="https://api.libcast.com/user/johnsmith">
    <username>johnsmith</slug>
    <first_name>John</first_name>
    <last_name>Smith</last_name>
    <email>john.smith@example.org</email>
    <telephone>(+44) 515 568 470</telephone>
    <address>15, Main Street</address>
    <zipcode>OL34T2</zipcode>
    <city>Oldham</city>
    <country>United Kingdom</country>
    <language>English</language>
    <is_active>1</is_active>
  </user>
  [..]
</users>

User info

Request:

GET /user/johnsmith HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<user href="https://api.libcast.com/user/johnsmith">
  <username>johnsmith</slug>
  <first_name>John</first_name>
  <last_name>Smith</last_name>
  <email>john.smith@example.org</email>
  <telephone>(+44) 515 568 470</telephone>
  <address>15, Main Street</address>
  <zipcode>OL34T2</zipcode>
  <city>Oldham</city>
  <country>United Kingdom</country>
  <language>English</language>
  <is_active>1</is_active>
  <platform href="https://api.libcast.com/platform/birds" />
  <profile href="https://api.libcast.com/profile/student" />
  <accesses href="https://api.libcast.com/user/johnsmith/accesses" />
</user>

User authenticate

Request:

GET /user/johnsmith/authenticate HTTP/1.0
cipher: [ user password encrypted with a valid RSA public key and converted from binary to hexadecimal ]

Response:

HTTP/1.0 302 Found
Location: /user/johnsmith
<?xml version="1.0" charset="UTF-8" ?>
<redirection>
  <url>/user/johnsmith</url>
</redirection>

User create

Request:

POST /platform/birds/users HTTP/1.0
profile: student
username: johnsmith
password: p4ssword
first_name: John
last_name: Smith
email: john.smith@example.org
telephone: (+44) 515 568 470
address: 15, Main Street
zipcode: OL34T2
city: Oldham
country: GB
language: en
is_active: 1

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<user href="https://api.libcast.com/user/johnsmith">
  <username>johnsmith</slug>
  <first_name>John</first_name>
  <last_name>Smith</last_name>
  <email>john.smith@example.org</email>
  <telephone>(+44) 515 568 470</telephone>
  <address>15, Main Street</address>
  <zipcode>OL34T2</zipcode>
  <city>Oldham</city>
  <country>United Kingdom</country>
  <language>English</language>
  <is_active>1</is_active>
  <platform href="https://api.libcast.com/platform/birds" />
  <profile href="https://api.libcast.com/profile/student" />
  <accesses href="https://api.libcast.com/user/johnsmith/accesses" />
</user>

User update

Request:

PUT /user/johnsmith HTTP/1.0
email: john.smith@birds.com

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<user href="https://api.libcast.com/user/johnsmith">
  <username>johnsmith</slug>
  <first_name>John</first_name>
  <last_name>Smith</last_name>
  <email>john.smith@birds.com</email>
  <telephone>(+44) 515 568 470</telephone>
  <address>15, Main Street</address>
  <zipcode>OL34T2</zipcode>
  <city>Oldham</city>
  <country>United Kingdom</country>
  <language>English</language>
  <is_active>1</is_active>
  <platform href="https://api.libcast.com/platform/birds" />
  <profile href="https://api.libcast.com/profile/student" />
  <accesses href="https://api.libcast.com/user/johnsmith/accesses" />
</user>

User delete

Request:

DELETE /user/johnsmith HTTP/1.0

Response:

HTTP/1.0 204 No Content

User group

User groups are attached to a platform. A user group is described by the following properties:

  • slug: automatically generated from the name (UNIQUE)
  • name: a 255 variable length string (REQUIRED)
  • platform: valid platform slug (REQUIRED)

User group list

Request:

GET /platform/birds/groups HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<groups>
  <group href="https://api.libcast.com/group/1st-grade-students">
    <slug>1st-grade-students</slug>
    <name>1st Grade Students</name>
  </group>
  [..]
</groups>

User group info

Request:

GET /group/1st-grade-students HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<group href="https://api.libcast.com/group/1st-grade-students">
  <slug>1st-grade-students</slug>
  <name>1st Grade Students</name>
  <platform href="https://api.libcast.com/platform/birds" />
  <users href="https://api.libcast.com/group/1st-grade-students/users" />
  <accesses href="https://api.libcast.com/group/1st-grade-students/accesses" />
</group>

User group create

Request:

POST /platform/birds/groups HTTP/1.0
name: 1st Grade Students

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<group href="https://api.libcast.com/group/1st-grade-students">
  <slug>1st-grade-students</slug>
  <name>1st Grade Students</name>
  <platform href="https://api.libcast.com/platform/birds" />
  <users href="https://api.libcast.com/group/1st-grade-students/users" />
  <accesses href="https://api.libcast.com/group/1st-grade-students/accesses" />
</group>

User group update

Request:

PUT /group/1st-grade-students HTTP/1.0
name: Students (1st Grade)

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<group href="https://api.libcast.com/group/1st-grade-students">
  <slug>1st-grade-students</slug>
  <name>Students (1st Grade)</name>
  <platform href="https://api.libcast.com/platform/birds" />
  <users href="https://api.libcast.com/group/1st-grade-students/users" />
  <accesses href="https://api.libcast.com/group/1st-grade-students/accesses" />
</group>

User group delete

Request:

DELETE /group/1st-grade-students HTTP/1.0

Response:

HTTP/1.0 204 No Content

Add a user in a group

Request:

POST /group/1st-grade-students/users HTTP/1.0
username: johnsmith

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<users>
  <user href="https://api.libcast.com/user/johnsmith">
    <username>johnsmith</slug>
    <first_name>John</first_name>
    <last_name>Smith</last_name>
    <email>john.smith@example.org</email>
    <telephone>(+44) 515 568 470</telephone>
    <address>15, Main Street</address>
    <zipcode>OL34T2</zipcode>
    <city>Oldham</city>
    <country>United Kingdom</country>
    <language>English</language>
  </user>
</users>

List group users

Request:

GET /group/1st-grade-students/users HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<users>
  <user href="https://api.libcast.com/user/johnsmith">
    <username>johnsmith</slug>
    <first_name>John</first_name>
    <last_name>Smith</last_name>
    <email>john.smith@example.org</email>
    <telephone>(+44) 515 568 470</telephone>
    <address>15, Main Street</address>
    <zipcode>OL34T2</zipcode>
    <city>Oldham</city>
    <country>United Kingdom</country>
    <language>English</language>
  </user>
</users>

Remove a user from a group

Request:

DELETE /group/1st-grade-students/user/johnsmith HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<users />

Role

A role is described by the following properties:

  • slug: automatically generated from the name (UNIQUE)
  • name: a 255 variable length string (REQUIRED)
  • platform: valid platform slug (REQUIRED)
  • permissions: array of permissions on domain models

Role list

Request:

GET /platform/birds/roles HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<roles>
  <role href="https://api.libcast.com/role/contributor">
    <slug>contributor</slug>
    <name>Contributor</name>
  </role>
  [..]
</roles>

Role info

Role info service shows the permissions on the Role: 0 when the role does not have the permission, 1 when it has the permission.

Request:

GET /role/contributor HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<role href="https://api.libcast.com/role/contributor">
  <slug>contributor</slug>
  <name>Contributor</name>
  <permissions>
    <platform>
      <view>0</view>
      <view_protected>0</view_protected>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
    </platform>
    <media>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
      <change_theme>0</change_theme>
      <manage_access>0</manage_access>
    </media>
    <stream>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>1</create>
      <edit>0</edit>
      <delete>0</delete>
      <change_theme>1</change_theme>
      <manage_access>1</manage_access>
    </stream>
    <resource>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>1</create>
      <edit>0</edit>
      <delete>0</delete>
      <activate_rating>1</activate_rating>
      <export>1</export>
    </resource>
  </permissions>
  <platform href="https://api.libcast.com/platform/birds" />
</role>

Role create

Permissions are given in nested request parameters.

Request:

POST /platform/birds/roles HTTP/1.0
name: Contributor
permission[Platform][view]: 1
permission[Media][delete]: 1
permission[Resource][create]: 0

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<role href="https://api.libcast.com/role/contributor">
  <slug>contributor</slug>
  <name>Contributor</name>
  <permissions>
    <platform>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
    </platform>
    <media>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>0</create>
      <edit>0</edit>
      <delete>1</delete>
      <change_theme>0</change_theme>
      <manage_access>0</manage_access>
    </media>
    <stream>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>1</create>
      <edit>0</edit>
      <delete>0</delete>
      <change_theme>1</change_theme>
      <manage_access>1</manage_access>
    </stream>
    <resource>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
      <activate_rating>1</activate_rating>
      <export>1</export>
    </resource>
  </permissions>
  <platform href="https://api.libcast.com/platform/birds" />
</role>

Resource update

Request:

PUT /role/contributor HTTP/1.0
permission[Media][create]: 1
permission[Resource][create]: 1

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<role href="https://api.libcast.com/role/contributor">
  <slug>contributor</slug>
  <name>Contributor</name>
  <permissions>
    <platform>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
    </platform>
    <media>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>1</create>
      <edit>0</edit>
      <delete>1</delete>
      <change_theme>0</change_theme>
      <manage_access>0</manage_access>
    </media>
    <stream>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>1</create>
      <edit>0</edit>
      <delete>0</delete>
      <change_theme>1</change_theme>
      <manage_access>1</manage_access>
    </stream>
    <resource>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>1</create>
      <edit>0</edit>
      <delete>0</delete>
      <activate_rating>1</activate_rating>
      <export>1</export>
    </resource>
  </permissions>
  <platform href="https://api.libcast.com/platform/birds" />
</role>

Resource delete

Request:

DELETE /role/contributor HTTP/1.0

Responses:

HTTP/1.0 204 No Content

Profile

A profile is described by the following properties:

  • slug: automatically generated from the name (UNIQUE)
  • name: a 255 variable length string (REQUIRED)
  • quota: (in bytes) 0 means unlimited (REQUIRED)
  • platform: valid platform slug (REQUIRED)

###Profile list

Request:

GET /platform/birds/profiles HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<profiles>
  <profile href="https://api.libcast.com/profile/student">
    <slug>student</slug>
    <name>Student</name>
    <platform href="https://api.libcast.com/platform/birds" />
  </profile>
  [..]
</profiles>

###Profile info

Profile info service shows the permissions on the Profile: 0 when the profile does not have the permission, 1 when it has the permission.

Request:

GET /profile/platform-administrator HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<profile>
  <slug><![CDATA[platform-administrator]]></slug>
  <name><![CDATA[Platform administrator]]></name>
  <quota>524288000</quota>
  <permissions>
    <instance>
      <view>1</view>
    </instance>
    <user>
      <view>1</view>
      <create>1</create>
      <edit>1</edit>
      <delete>1</delete>
      <manage_access>1</manage_access>
    </user>
    <user_role>
      <view>1</view>
      <create>1</create>
      <edit>1</edit>
      <delete>1</delete>
    </user_role>
    <user_profile>
      <view>1</view>
      <create>1</create>
      <edit>1</edit>
      <delete>1</delete>
    </user_profile>
    <group>
      <view>1</view>
      <create>1</create>
      <edit>1</edit>
      <delete>1</delete>
      <manage_access>1</manage_access>
    </group>
    <platform>
      <view>0</view>
      <view_protected>0</view_protected>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
      <manage_commerce>0</manage_commerce>
    </platform>
    <file>
      <create>1</create>
      <edit>1</edit>
      <delete>1</delete>
      <record>1</record>
      <private_share>1</private_share>
      <publish_animation>1</publish_animation>
      <publish_audio>1</publish_audio>
      <publish_binary>1</publish_binary>
      <publish_document>1</publish_document>
      <publish_image>1</publish_image>
      <publish_richmedia>1</publish_richmedia>
      <publish_text>1</publish_text>
      <publish_video>1</publish_video>
      <share>1</share>
      <access>1</access>
    </file>
    <folder>
      <create>1</create>
    </folder>
    <metadata>
      <manage>0</manage>
    </metadata>
    <category>
      <manage>1</manage>
      <use>1</use>
    </category>
    <tag>
      <manage>1</manage>
      <use>1</use>
    </tag>
    <analytics>
      <view>1</view>
    </analytics>
    <video_recorder>
      <manage>0</manage>
      <use>0</use>
    </video_recorder>
    <player_theme>
      <create>1</create>
      <edit>1</edit>
      <delete>1</delete>
      <use>1</use>
    </player_theme>
    <player_behavior>
      <create>1</create>
      <edit>1</edit>
      <delete>1</delete>
      <use>1</use>
    </player_behavior>
    <logo>
      <manage>1</manage>
      <use>1</use>
    </logo>
    <clip>
      <manage>1</manage>
      <use>1</use>
    </clip>
  </permissions>
  <platform><![CDATA[https://api.libcast.com/platform/birds]]></platform>
</profile>

Profile create

Permissions are given in nested request parameters.

Request:

POST /platform/birds/roles HTTP/1.0
name: Administrator
quota: 524288000
permission[Platform][view]: 1
permission[User][create]: 1
permission[Group][create]: 0

Response:

HTTP/1.0 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<profile>
  <slug><![CDATA[Administrator]]></slug>
  <name><![CDATA[Administrator]]></name>
  <quota>524288000</quota>
  <permissions>
    <instance>
      <view>0</view>
    </instance>
    <user>
      <view>0</view>
      <create>1</create>
      <edit>0</edit>
      <delete>0</delete>
      <manage_access>0</manage_access>
    </user>
    <user_role>
      <view>0</view>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
    </user_role>
    <user_profile>
      <view>0</view>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
    </user_profile>
    <group>
      <view>0</view>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
      <manage_access>0</manage_access>
    </group>
    <platform>
      <view>1</view>
      <view_protected>0</view_protected>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
      <manage_commerce>0</manage_commerce>
    </platform>
    <file>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
      <record>0</record>
      <private_share>0</private_share>
      <publish_animation>0</publish_animation>
      <publish_audio>0</publish_audio>
      <publish_binary>0</publish_binary>
      <publish_document>0</publish_document>
      <publish_image>0</publish_image>
      <publish_richmedia>0</publish_richmedia>
      <publish_text>0</publish_text>
      <publish_video>0</publish_video>
      <share>0</share>
      <access>0</access>
    </file>
    <folder>
      <create>0</create>
    </folder>
    <metadata>
      <manage>0</manage>
    </metadata>
    <category>
      <manage>0</manage>
      <use>0</use>
    </category>
    <tag>
      <manage>0</manage>
      <use>0</use>
    </tag>
    <analytics>
      <view>0</view>
    </analytics>
    <video_recorder>
      <manage>0</manage>
      <use>0</use>
    </video_recorder>
    <player_theme>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
      <use>0</use>
    </player_theme>
    <player_behavior>
      <create>0</create>
      <edit>0</edit>
      <delete>0</delete>
      <use>0</use>
    </player_behavior>
    <logo>
      <manage>0</manage>
      <use>0</use>
    </logo>
    <clip>
      <manage>0</manage>
      <use>0</use>
    </clip>
  </permissions>
  <platform><![CDATA[https://api.libcast.com/platform/birds]]></platform>
</profile>

Access

An access is described by the following properties:

  • username group: identifier of the subject of the access: username or group slug (REQUIRED)
  • platform media stream resource: identifier of the object of the access: slug of a platform, a media,
  • a stream or a resource (REQUIRED)
  • role: role slug (REQUIRED)

Access list

Request for group accesses:

GET /group/birds-breeders/accesses HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<accesses>
  <access href="https://api.libcast.com/user/johnsmith/accesses/1">
    <group href="https://api.libcast.com/group/1st-grade-students" />
    <media href="https://api.libcast.com/media/birds-blogers" />
    <role href="https://api.libcast.com/role/viewer" />
  </access>
    <access href="https://api.libcast.com/user/johnsmith/accesses/2">
    <group href="https://api.libcast.com/group/1st-grade-students" />
    <stream href="https://api.libcast.com/stream/1st-grade-global-blog" />
    <role href="https://api.libcast.com/role/contributor" />
  </access>
</accesses>

Request for user accesses:

GET /user/johnsmith/accesses HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<accesses>
  <access href="https://api.libcast.com/user/johnsmith/accesses/3">
    <user href="https://api.libcast.com/user/johnsmith" />
    <stream href="https://api.libcast.com/stream/john-s-blog" />
    <role href="https://api.libcast.com/role/contributor" />
  </access>
</accesses>

Request for resource accesses:

GET /resource/little-swallows-4-weeks/accesses HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<accesses>
  <access href="https://api.libcast.com/resource/little-swallows-4-weeks/accesses/3">
    <user href="https://api.libcast.com/user/johnsmith" />
    <resource href="https://api.libcast.com/resource/little-swallows-4-weeks" />
    <role href="https://api.libcast.com/role/contributor" />
  </access>
</accesses>

Request for stream accesses:

GET /stream/john-s-blog/accesses HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<accesses>
  <access href="https://api.libcast.com/stream/john-s-blog/accesses/3">
    <user href="https://api.libcast.com/user/johnsmith" />
    <stream href="https://api.libcast.com/stream/john-s-blog" />
    <role href="https://api.libcast.com/role/contributor" />
  </access>
</accesses>

Request for media accesses:

GET /media/birds-blogers/accesses HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<accesses>
  <access href="https://api.libcast.com/media/birds-blogers/accesses/3">
    <user href="https://api.libcast.com/user/johnsmith" />
    <stream href="https://api.libcast.com/media/birds-blogers" />
    <role href="https://api.libcast.com/role/contributor" />
  </access>
</accesses>

Request for platform accesses:

GET /platform/birds/accesses HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<accesses>
  <access href="https://api.libcast.com/platform/birds/accesses/3">
    <user href="https://api.libcast.com/user/johnsmith" />
    <platform href="https://api.libcast.com/platform/birds" />
    <role href="https://api.libcast.com/role/contributor" />
  </access>
</accesses>

Access info

There is no access info service.

Access create

Request:

POST /user/johnsmith/accesses HTTP/1.0
stream: chicken
role: moderator

Response:

HTTP/1.0 201 Created
<?xml version="1.0" charset="UTF-8" ?>
<accesses>
  <access href="https://api.libcast.com/user/johnsmith/accesses/3">
    <user href="https://api.libcast.com/user/johnsmith" />
    <stream href="https://api.libcast.com/stream/john-s-blog" />
    <role href="https://api.libcast.com/role/contributor" />
  </access>
    <access href="https://api.libcast.com/user/johnsmith/accesses/4">
    <user href="https://api.libcast.com/user/johnsmith" />
    <stream href="https://api.libcast.com/stream/chicken" />
  <role href="https://api.libcast.com/role/moderator" />
  </access>
</accesses>

Access update

There is no access update service. You have just to delete the deprecated access and create a new one.

Access delete

Request:

DELETE /user/johnsmith/accesses/3 HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<accesses>
  <access href="https://api.libcast.com/user/johnsmith/accesses/4">
    <user href="https://api.libcast.com/user/johnsmith" />
    <stream href="https://api.libcast.com/stream/chicken" />
    <role href="https://api.libcast.com/role/moderator" />
  </access>
</accesses>

Publication channel

A publication channel is defined by the following properties:

Property Type Default Cardinality Notes
name string(64)   1  
type string(64)   1  
is_online boolean TRUE 1  

Common channel types are: web, widget, api and syndication.

Some channel types provide some additional properties. Web publication channels:

Property Type Default Cardinality Notes
theme string(64)   [1]  
skin string(64)   [1]  

A theme defines the global appearance of a web channel (Web TV, blogs, …) and skins are just color variations upon the themes).

List publication channels

The URL to reach the list of publication channels in a media is given in the Media show service:

GET /media/eagle-tv HTTP/1.0
HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<media href="https://api.libcast.com/media/eagle-tv">
  [..]
  <channels href="https://api.libcast.com/media/eagle-tv/channels"/>
</media>

Response status: 200, 401, 403, 404, 500

Example request:

GET /media/eagle-tv/channels HTTP/1.0

Example response:

HTTP/1.0 200 OK
Content-Type: application/vnd.libcast+xml
<?xml version="1.0" charset="UTF-8" ?>
<channels>
  <channel href="https://api.libcast.com/media/eagle-tv/channel/web-tv">
    <name>Blogs about birds</name>
    <type>web</type>
    <is_online>1</is_online>
    <theme>blogs</theme>
    <skin>tungsten</skin>
  </channel>
  <channel href="https://api.libcast.com/media/eagle-tv/channel/widgets">
    <name>Widgets of birds</name>
    <type>widget</type>
    <is_online>1</is_online>
  </channel>
</channels>

Create publication channel

Response status: 201, 401, 403, 404, 412, 500

Example request:

POST https://api.libcast.com/media/eagle-tv/channels HTTP/1.0
type=syndication&name=iTunes channel

Example response:

HTTP/1.0 201 Created
Content-Type: application/vnd.libcast+xml
<channel href="https://api.libcast.com/media/eagle-tv/channel/itunes-channel">
  <name>iTunes channel</name>
  <type>syndication</type>
  <is_online>1</is_online>
</channel>

Retrieve publication channel

Response status: 200, 401, 403, 404, 500

Example request:

GET https://api.libcast.com/media/eagle-tv/channel/itunes-channel HTTP/1.0

Example response:

HTTP/1.0 200 Ok
Content-Type: application/vnd.libcast+xml
<channel href="https://api.libcast.com/media/eagle-tv/channel/itunes-channel">
  <name>iTunes channel</name>
  <type>syndication</type>
  <is_online>1</is_online>
</channel>

Update publication channel

Response status: 201, 401, 403, 404, 412, 500

Example request:

PUT https://api.libcast.com/media/eagle-tv/channel/itunes-channel HTTP/1.0
name=iTunes

Example response:

HTTP/1.0 201 Created
Content-Type: application/vnd.libcast+xml
<channel href="https://api.libcast.com/media/eagle-tv/channel/itunes-channel">
  <name>iTunes</name>
  <type>syndication</type>
  <is_online>1</is_online>
</channel>

Delete publication channel

Response status: 204, 401, 403, 404, 500

Example request:

DELETE https://api.libcast.com/media/eagle-tv/channel/itunes-channel HTTP/1.0

Example response:

HTTP/1.0 204 No Content

Extension widgets

Some Libcast GUI features can be embedded into third-party applications. For example, the audio/video recorder with which a user can record itself with its webcam/microphone and the result is sent to its Libcast briefcase.

The extensions delivered by the web service includes a unique identifier and are usable only once. The request must be repeated each time the extension is included in the third-party application.

Get an extension widget

At this moment, the audio/video recorder is the only available extension. The <code /> tag contains the URL-encoded widget code.

GET /extension/widget/recorder HTTP/1.0

Response:

HTTP/1.0 200 OK
<?xml version="1.0" charset="UTF-8" ?>
<widget>
  <code><![CDATA[...]]></code>
</widget>