updateThumbnailFromUrl returns SERVICE_FORBIDDEN

I’m uploading an audio only file and assigning the mediatype as audio but anything longer than 1 second it removed the speaker thumbnail and leaves you a black box (probably extracted from no video from from file)

so I try to replace it with a thumbnail after conversion. I get forbidden access using updateThumbnailFromUrl

$config = new KalturaConfiguration();
$config->serviceUrl = ‘https://www.kaltura.com/’;
$client = new KalturaClient($config);
$entryId = ‘0_entryID’;
$url = ‘https://mysite.com/images/720.jpg’;
$result = $client->media->updateThumbnailFromUrl($entryId, $url);


        <message>The access to service [media-&gt;updateThumbnailFromUrl] is forbidden</message>

If the file you’re uploading is audio only, I see no reason for it not to be assigned the default audio thumbnail. If the file has a video track, however, I can see why this would happen. You can check whether a video track exists using the mediainfo util. If that’s the case and you are only interested in the audio, you can use ffmpeg to extract only the audio track and save it onto a separate file.
As for KalturaAPIException SERVICE_FORBIDDEN The access to service [media->updateThumbnailFromUrl] is forbidden, I don’t see you’re setting a KS in your code… are you setting it and did not provide the full code?

You need something like this:

  $type = KalturaSessionType::ADMIN;
  $partnerId = 0;
  $expiry = 86400;
  $privileges = null;

  try {
    $ks = $client->session->start($secret, $userId, $type, $partnerId, $expiry, $privileges);
  } catch (Exception $e) {
    echo $e->getMessage();

If you are setting the KS in your code, please provide the full code [masking your secret, of course] and I’ll take a look.

yes I’ve created a $client with a session

then all I would have to do is update an entry with a url to a valid image

$client->media->updateThumbnailFromUrl($entryId, $url);

but ti returns SERVICE_FORBIDDEN

you can try it in the test me console

I did. Worked perfectly well for me.
Please provide the full code.

sorry for not getting back, been busy. seems I forgot to paste session into testme after starting a session. used to be you didn’t have to do that will subsequent calls after started a session.

back back to original issue. audio thumbnail gets replaced with black because the transcoding removes it and tries to find a frame of nothing. and I was trying to swap thumbnail before transcodes finish. so I have to do a cron that checks whether the ntry is ready then swap in the audio thumbnail