The fact Kaltura is open sourced provides users of the Kaltura platform with many advantages. Amongst which, the ability to shape and influence the platform and its roadmap by contributing code to the project.

Very often, when building a new integration or a publishing workflow, it’s a bit too much to dive into the core platform code. With Kaltura you don’t have to!

Kaltura is a RESTful API and Microservices driven platform.
This means that all features, user facing or internal, are based on the same unified API broken down by services that are atomic and independent.
From upload and transcoding to playback and analytics, all platform components are controlled via the same unified API. Even the platform internals such as managing backend nodes, account configurations, etc.

A RESTful API follows these basic concepts:

  • It’s uniform – in Kaltura, every service represents an object, and actions represent its methods . For example: the media service represents the KalturaMediaEntry object. The media.delete action deletes a given KalturaMediaEntry object.
  • It’s stateless – In every API call you must provide a valid session key (dubbed KS). You can create as many sessions as you need at the same time.
  • It’s cache-able – Scale is a make or break with video applications and caching is a mandatory component.
  • Layered System – Clients have a single end point. Intermediary servers improve system scalability by enabling load-balancing and shared caches. Layers also enforce security policies and enhance system resilience.

A lot of projects offer a RESTful API. But what I believe makes the Kaltura API special is –

It’s API from the inside out!
The platform’s own components also use the same APIs to get their job done. This means core developers build and test using the same APIs that App developers use. Which in turn tests and improves the APIs daily.

Always up-to-date SDKs
Kaltura’s API features a unique automatic generation of SDK. With every release Kaltura generates new client libraries. Which are available for most popular programming languages, including: PHP, Ruby, Python and JavaScript.
See the Kaltura.com client libraries page for complete list and downloads.

It’s Robust, Allowing Complete Control
The API is capable of controlling pretty much any operation in the platform’s core components. From ingesting content through management and transcoding, to playback, delivery, distribution and analytics.

To further explain point A, let’s dive into the Kaltura architecture:

 

The API and Client Libraries are used across the platform’s components, both in external applications such as Kaltura MediaSpace and various modules for 3rd party systems such as Drupal or WordPress, as well as internally, within the core Kaltura components such as transcoding, batch servers or the platform’s Admin Console.

For example, the batch daemon, responsible for performing roles such as: media import, media info extraction, transcoding and server notifications, triggers these APIs the same way any other party, like, your own application, would: using the Kaltura API Client libraries.

Here is a short example of how the APIs (in this particular case, using the PHP client lib) can be used to upload a new video entry to the system:

Having an API driven architecture enables complete control and freedom with how you want your application workflows and UI to behave. From creating different publishing workflows to exposing sets of functionalities.
In addition, the API inside-out approach opens up many opportunities for adapting, controlling and extending beyond the simple UI workflows and apps, important examples for that are platform automation and monitoring tools.

 

Playing with the API:

As mentioned, Kaltura provides client libs generated for various programming languages. In addition, API calls can be made using a testing tool dubbed the Kaltura TestMe console.
The first thing you would want to do is create a Kaltura Session – KS:

  1. Select ‘session’ as service and ‘start’ as action.
  2. In session type, select ‘USER’.
  3. The secret field corresponds to one of two strings that are saved in Kaltura for each partner and are available in your KMC under the Settings>Integration Settings tab. Note that there are two types of secrets, one that can be used to start a USER session and one to start an ADMIN session.

 

testme_session_start

If you look at the screenshot above, you will see that, in the right frame, we have the returned XML which includes:

  • The result tag with the KS ‘N2E1NGE1NGIxOGFlNWI3MDU1NWY4YTNmMjM2QwZDg2ZDA1YjM0MHwyNDk7MjQ5OzEzOTkyODc1OTA7MDsxMzk5MjAxMTkwLjM1NDs7Ozs=’ as value
  • The executionTime tag with 3.71932983398 as value

At the bottom of the page, you can see the code our selections in the input form generated.

Notice that while the default displayed code is in PHP, you can click on one of the other languages to see the code generated for them.

 

As a second example for using the Test Me Console, we will list the entries our partner owns, by using the baseEntry service and calling its listAction() action.

testme_baseentry_list

As you can see, the generated code reads:

If you run this code and add:

You will get a result very similar to the XML outputted in the right frame of the page in the screenshot above.

 

The Test Me Console is a useful method for exploring the Kaltura API. Simply browse through available services and see what actions can be made.

Then, you can copy the code snippet and shape it into something useful within your scripts.

 

Hopefully this article will help you get started with the Kaltura APIs.

Browse the Kaltura API Documentation Set to learn more and explore more Kaltura APIs.

For questions, leave a comment below, or start a thread in the forums.

Download, install and take part in the Community.

 

Happy coding 🙂

 

The Video Experience Hackathon endded. You can explore the winning projects at: http://videoxhackathon.devpost.com/submissions.

Share this
Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+Email this to someone

Website Comments

Post a comment