Creating image with base 64 byte array returns invalid image v201502

86 views
Skip to first unread message

Vince NexonM

unread,
Jun 23, 2015, 11:24:18 PM6/23/15
to adwor...@googlegroups.com
Following the image documentation


It's stated that the raw data image should be base 64 byte array, but I kept getting an invalid image error.

I then decided to try the regular byte array, non base 64 format, and it accepted and I can see my image ad in my campaign now. Is that a typo in the documentation or am I reading it wrong?


Vince


Josh Radcliff (AdWords API Team)

unread,
Jun 24, 2015, 11:26:23 AM6/24/15
to adwor...@googlegroups.com, vin...@nexonm.com
Hi Vince,

I think that what's happening here is that the SOAP toolkit is performing the base64 encoding for you, so if you base64 encode the value as well, you're double-encoding and that leads to the error.

For example, in the Java client library, the type of the Image.data field is simply byte[], so when creating an Image object I can simply set that field to the raw byte array. However, when the underlying SOAP toolkit (e.g., Apache Axis) builds the message, it base64 encodes those bytes.

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages