Is there a get for media by ReferenceID

/usr/local/lib/node_modules/kaltura/KalturaVO.js:function KalturaMediaEntryFilter(){

Also:
https://github.com/kaltura/KalturaGeneratedAPIClientsNodeJS/blob/master/KalturaVO.js#L3326

Yeah, for some reason the module is not being exported with my setup.

I had to use

 var Kaltura =  require('Kaltura/KalturaClient'); 

To get the client working, trying to work out why the KalturaMediaEntryFilter is not available …

There is something broken in this module, will try work it out … but just so you know …

Same result … undefined

I can see the object in the Client Object … there must be something wrong with the way the module export is being done ?
Do you need to define a module.exports = { } before populating … I am not a node expert, in the past I always have used

module.exports = {

    add: function(x, y, z) {
    },
    remove: function(x,y,z) {
    }

}

etc …

var type = require(‘kaltura/KalturaVO’);
var filter = new type.KalturaMediaEntryFilter();
var pager = new type.KalturaFilterPager();
//var filter = new Filter();
filter.referenceIdEqual = “11111”;

var res = client.media.list(mycb, filter, pager)

Now getting client.media.list is not a function

Hi,

Where do you instantiate the client? do not see it in the code you pasted…

I can see a “listAction” defined, not a list … my client seems ok from the object dump.
When I use client.media.listAction

var client = new Kaltura.KalturaClient(config);    client.session.start(function(ks) {
if (ks.code && ks.message) {
            console.log('Error starting session', success, ks);
        } else {
            client.setKs(ks);
            console.log("Success: " + require('util').inspect(client, false, null));
        }
    }, "xxxxxxxxxxxx",
    "yyyy@vvvvv.com",
    Kaltura.enums.KalturaSessionType.ADMIN,
    0000000);

Hello,

Yes, this is due to:


It was done so because ‘list’ is a preserved word in PHP, in JS, it actually isn’t but that is the origin of the issue.
Please use listAction()

Thanks,

Thanks, I have tried using listAction, but i can’t get any response other than undefined …

  var mycb = function(success, results) {
    if(!success) {
        console.log("failed:" + results);
    } else {
        console.log("passed:" + results);
    }

};
var res = client.media.listAction(mycb, filter, pager);

The callback gets a “success” but the result is undefined , so the output reads
passed: undefined

this is the actual request being sent with some signatures changed etc …

POST //api_v3/index.php?service=media&action=list&undefined HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 349
Host: www.kaltura.com
Connection: close

format=1&apiVersion=3.3.0&clientTag=node%315-10-2&filter:objectType=KalturaMediaEntryFilter&filter:referenceIdEqual=3142&pager:objectType=KalturaFilterPager&ks=djJ8MTc3NjI2MXwNOWkC9FHKp_c63YyqBvLbk8CuRDu9MtR16i1titOBkP2WUSgi42xj00EX84_uqZIJNX-uKiQ_yTN3khSis5PQtVWYCXtEjGFBE1JsPJ0dB2A%3D&kalsig=d080dd2a477493e38be72f76509a

Actually in the RAW HTTP Log I can see the data …

Please share the full code so I can help you further.

In the callback function the results are not set , but the data comes back in the first success parameter

It took a lot of reverse engineering to get this to work. Firstly the way the module exports work and then the way in which the data is handled compared to how it is documented. I think these should be fixed :wink:

We are always happy to get contributions, both to code and to documentation:)
See https://github.com/kaltura/platform-install-packages/blob/Kajam-11.2.0/doc/Contributing-to-the-Kaltura-Platform.md for additional info.

Ok, I will see what I can do :slight_smile:

Also, for code reference with NodeJS, look at developer.kaltura.org which contains actual code examples using the API, one of the available langs is NodeJS.

The NodeJS ones need some work … I have looked at it before … tks for the help.

Welcome and again, will be happy to get feedback as to what you feel needs changing.