Can anyone help take a loot what is wrong with my NodeJS code? client.media.listAction returns error below. We use Kaltura SaaS.
“The access to service [media->list] is forbidden”
var kaltura = require(’./KalturaClient.js’);
var kalturaTypes = require(’./KalturaTypes.js’);
var vo = require(’./KalturaVO.js’)
var cb = function (results){
if(results){
console.log(results);
return;
}
}
var partnerId = 188XXXX;
var conf = new kaltura.KalturaConfiguration(partnerId);
conf.serviceUrl = “http://www.kaltura.com”;
var client = new kaltura.KalturaClient(conf);
var secret = “adminsecretinKMC”;
var userId = “myemailaddress”;
var type = kalturaTypes.KalturaSessionType.ADMIN;
var expiry = 100000;
var privileges = null;
client.session.start(cb, secret, userId, type, partnerId, expiry, privileges);
var filter = new vo.KalturaMediaEntryFilter();
var filterAdvancedSearch = new vo.KalturaMetadataSearchItem();
filterAdvancedSearch.type = 2; //kaltura.KalturaSearchOperatorType.SEARCH_OR;
filterAdvancedSearch.metadataProfileId = 31;
var filterAdvancedSearchItems = new vo.KalturaSearchCondition();
filterAdvancedSearchItems.field = “/[local-name()=‘metadata’]/[local-name()=‘MediaType’]”; // MediaType is the system name is Custom Data in KMC
filterAdvancedSearchItems.value = ‘1’;
filterAdvancedSearch.items = [filterAdvancedSearchItems];
filter.advancedSearch = filterAdvancedSearch;
client.media.listAction(function(results){console.log(results);
}, filter, null);