I’m trying to retrieve all videos from my account using media.list, but the API is only returning videos owned by my user. After some investigation, I believe the problem lies in how I’m generating the ks and its admin privileges, as I tried the same script using the ks generated in the KMC and it worked.
I set up the session as follows:
var PARTNER_ID = 1234;
var USER_ID = 'me@domain.com';
var SECRET = '123456';
var config = new KalturaConfiguration(PARTNER_ID);
var client = new KalturaClient(config);
client.session.start(function(success, ks) {
// ... store the client ...
}, SECRET, USER_ID, KalturaSessionType.ADMIN, PARTNER_ID);
Later on, I try to retrieve all the videos on my account (including by other users).
var filter = new KalturaMediaEntryFilter();
var pager = new KalturaFilterPager();
client.media.listAction(function(success, results) {
// ... handle results ...
}, filter, pager);
However, it only returns the videos owned by my user (USER_ID). How can I retrieve all videos instead?
Also, to decode a KS, which could have helped you here, go to Admin Console->Developer->System Helper
Check “KS” and in the “String to manipulate:” input yours.
I have the same problem that Gabriel had and so I decided to follow this solution. The problem is that, when I set my “user_Id = None” since I am writing my program in python, I end up getting about 900 videos which are certainly not from my media. How can I get only the videos in my media. (both owned by me and not owned by me for a total of about 35 videos)
from KalturaClient import *
from KalturaClient.Plugins.Core import *
config = KalturaConfiguration()
client = KalturaClient(config)
#for privacy, I kept my id and secret keys private.
ks = client.session.start (
secret = admin_secret,
userId = None,
type = KalturaSessionType.USER,
partnerId = partner_secret,
expiry = 86400,
privileges = 'disableentitlement' )
client.setKs(ks)
print(ks)
Entries will appear under My media if you’re their owner (entry.userId == YOUR_USER_ID) or, if you’re listed as an editor or a publisher.
The KalturaMediaEntryFilter object includes these members: entitledUsersEditMatchOr entitledUsersPublishMatchOr userIdIn userIdEqual
The first three can accept a comma separated list of user IDs.