Tuesday 24 November 2015

Issue about Youtube Video Media creation

Hi,

I'm trying to create an In-stream video ad. According to template documentation, It seems that we need to create the media ad first, in order to get the media id. I've tried first create the Youtube Video Media as you can see below :


$user = new AdWordsUser();
$user->SetClientCustomerId('727-815-6373');
$mediaService = $user->GetService('MediaService', ADWORDS_VERSION);
$video = new Video();
$video->name='Youtube Video AD #' . uniqid();
$video->type = 'VIDEO';
$video->youTubeVideoIdString="oUNHV_kbmY0";
$result = $mediaService->upload(array($video));
printf("Video id '%s' was "
.    "uploaded.\n",  $result[0]->mediaId);

But I don't understand why I'm getting this error :


Uncaught SoapFault exception: [soap:Server] [MediaError.UNSUPPORTED_TYPE @ media[0]]

Thanks for any help.

Youssef

--

No comments:

Post a Comment