Invaild image in google adwords from php

36 views
Skip to first unread message

testapi...@gmail.com

unread,
Aug 27, 2016, 12:41:41 PM8/27/16
to AdWords API Forum
I try to add ImageAd to my google adwords script. My code view like this:

.....
 $img
= new Image();


  $imagedata
= file_get_contents($ad_data['link']);
$base64
= base64_encode($imagedata);
echo $base64
;
  $img
->data = $base64;

    $textAd
= new ImageAd();
    $textAd
->name = $ad_data['imagename']." #".uniqid();
    $textAd
->image = $img;
...

And now I have got this error:

An error has occurred: [ImageError.INVALID_IMAGE @ operations[0].operand.ad.image.data]

Input image source view like this: /var/www/my/site/imagefolder/m7im4.png

Do you have any idea ?


Shwetha Vastrad (AdWords API Team)

unread,
Aug 29, 2016, 11:38:51 AM8/29/16
to AdWords API Forum
Hi, 

Could you provide the complete SOAP XML request and response log when you tried to create the image Ad? Please use Reply privately to author when responding.

Thanks,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages