Upload videos to the flavour via API


what are the API functions to upload a video directly to a Flavour in an entry. I’m not asking about upload content but to upload to the flavour.

Via KMC I get it in Edit Entry -> Flavors -> (Action from a flavour) -> Upload. My question is how to do it via API.



Hello Lluis,

You can use the uploadToken and flavorAsset APIs to do so, here is a code sample using the PHP client:

$flavor_id = '0_6jen83sq';
$uploadToken = new KalturaUploadToken();
$tokenResult = $client->uploadToken->add($uploadToken);
$resume = null;
$finalChunk = null;
$resumeAt = null;
$result = $client->uploadToken->upload($tok, $fileData, $resume, $finalChunk, $resumeAt);
$contentResource = new KalturaUploadedFileTokenResource() ;
$result = $client->flavorAsset->setContent($flavor_id, $contentResource);

Thanks jess! This is the information that we were looking for,