Copyright © 2012 Kaltura Inc.
All Rights Reserved. Designated trademarks and brands are the property of their respective owners.
Use of this web site constitutes acceptance of the Terms of Use and Privacy Policy.
EduVideo.org
Hey folks- I'm trying to update clip data programatically (title and tags) using the API (we're using the Kaltura hosted solution), and I'm consistently getting SERVICE_FORBIDDEN.
Here's my PHP code:
$u = "http://www.kaltura.com/api_v3/?service=baseentry&action=update";
$data = array('id' => $id, "baseEntry:tags" => urlencode($tags), "baseEntry:title" => urlencode($title));
$ch = curl_init($u);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);
curl_close($ch);
The code is clearly firing, and if I remove the baseEntry object from the $data var, I get a different error that the required BaseEntry is missing.
I'm just not sure why I can't actually make the update. I've also tried it against the media object (which leads me to another question: what's the difference between media->update() and baseEntry->update()?)
Thanks!
-Rob
Ofer- Good question. Probably because I'm not terribly familiar with the API calls, and since the docs indicated that it wants POST data to the URL, I just figured I'd CURL it. I had a feeling that wasn't the right way to go about doing it, but I just don't know how to do it using the client (I've only pulled data back thus far), and the API docs are super confusing.
Would you be able to point me in the right direction using the client?
Thanks!
-Rob
Ofer- Thanks for initially questioning my use of CURL. I went back and began digging deeper into the client class files and was able to make it work properly using the client.
Thanks!
-Rob
Glad I could help
Hi Rob,
Try to follow this example :
$config = new KalturaConfiguration($partnerId);
$config->serviceUrl = 'http://www.kaltura.com/';
$client = new KalturaClient($config);
$entryId = $id;
$client->setKs($ks);
$baseEntry = new KalturaBaseEntry();
$baseEntry->name = 'updated name';
$baseEntry->tags = 'updated tags';
$results = $client-> baseEntry ->update($entryId, $baseEntry);
Orly.
Hi Rob,
Why are you switching in the middle of the code from Kaltura client to curl?
Media is a super-set of base entry, you can go over the client and see which field are being added by MediaEntry over BaseEntry.
Ofer