Quantcast
Channel: Kaltura - Latest posts
Viewing all articles
Browse latest Browse all 7410

How do I search by category via API?

$
0
0

Hello,

From the test console, you can do it by choosing media as service, list as action, click on edit above the filter field, check "categoriesIdsMatchOr" and input the category ID you're interested in. You also have categoriesIdsMatchAnd and categoriesMatchAnd categoriesMatchOr if you want to search by category names instead of IDs.
All these can accept one or more category names/IDs, comma separated.

The Python parallel of this, which will return entries attached to category ID 15, would be along the lines of:

config = KalturaConfiguration(PARTNER_ID)
config.serviceUrl = "SERVICE_URL"
client = KalturaClient(config)
filter = KalturaMediaEntryFilter()
filter.categoriesIdsMatchOr=15
pager = None
result = client.media.list(filter, pager)

If you're not getting a result using this, make sure there really are entries attached to that category. A good way to check is to find an entry you think is attached to it, call media.get() to make sure it returns with:

 <categories>your_cat_name</categories>
 <categoriesIds>your_cat_id</categoriesIds>

Viewing all articles
Browse latest Browse all 7410

Trending Articles