So I am trying to retrieve a list of all media under a category with some subcategories.
For example, I have a parent category, Main which has subcategories child_1, child_2…, child_i, where i = 50, and I want all the media from all subcategories.
To do so I make a media.list request and filter on ‘categoryAncestorIdIn’ using the ID for Main. However, this gives me a peculiar response where the media entries returned are not in any of the subcategories.
Am I just using the wrong filter field here? if so which one should I be using?
Also as a side question is there a way to filter out archived/hidden media?
I think I have got myself muddled up in the first post, hopefully this clears things up.
So In our system, we have some high-level categories for example, ‘Youtube’ which has the subcategories Projects, Careers, Events and so on. Then we have the category I want to query called ‘Trades’ which would include Engineering, Architecture etc.
So let’s say the Category ID for Trades is 123456, so I would use the media.list endpoint and specify in the filter for 'categoryAncestorIdIn’ = 123456, then make the request. This returns entries like this…
So as you can see the category given to this media entry is from a completely different category and when I check the subcategories of Trades ‘Projects’ is not one of them. Then when I look at the video itself in the KMC it says it is in the ‘Projects’ Category as well as ‘Engineering’ which is a subcategory of Trade.
So the real question is, how to have the categories field provide all the related categories or even better only the categories that are subcategories of the ancestor ID.
Please define ‘archived/hidden’. Feel free to provide sample entry IDs.
So I believe there is an option to make media ‘unlisted’ in Kaltura, when you request media from the API is this unlisted media returned?
1_00o07a38 is returned because it is associated with a sub category under the YouTube category (that’s not its exact name but since that’s how you referred to it, I’m doing the same) so yes, if you passed the “YouTube” cat ID in KalturaMediaEntryFilter.categoryAncestorIdIn when calling media.list(), the response will include it. If you passed something else, I’ll need you to share the exact value. Post the full KalturaMediaEntryFilter object you passed in the media.list() payload.
For reference, here are the category related members that are available to you on the KalturaMediaEntryFilter object:
So this is returning media from the Youtube category which is not a subcategory of Skills Networks. Although, when looking at the video in the KMC you can see it is in both. I don’t believe the query is at fault here as I want all the media under this one category even if it is also in another. However, I need the response to list all the categories, which would be “People, Bridge and Civil Structures”.
As noted in my previous response, the entry in question (ID 1_vtbv0tqp) should indeed be returned because, among other category associations, it is associated with a sub category that resides under category ID 19562491. I also understand your confusion in light of the fact the KalturaMediaEntry returned in the KalturaMediaListResponse only includes one category in its categories and categoriesIds members. The reason for that is that those two members are deprecated. In order to get ALL category assoc for a given entry, please use the categoryEntry.list() API. For instance:
If you mean developer.kaltura.com, then no, it does not (nor should it, it’s not always what one would want).
You can generate a KS with that privilege using https://developer.kaltura.com/console/service/session/action/start (or by any other means) and then set it under Global Parameters when you make the request.
Alternatively, you can use said KS when signing into the console by inputting it under Kaltura Session ID (ks) rather than inputting the username and password.