upload image for display ads

49 views
Skip to first unread message

V54328u

unread,
Jun 14, 2018, 3:31:54 AM6/14/18
to AdWords API and Google Ads API Forum
i am using api version 201802, when i try to upload image using media service
image.setData(com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl("));
i am not able to upload "https:" image.
when i upload "http " image , without changing anything in the code, its works fine..and ad is created.

any help would be appreciated..
thanks

Luis Xander Talag (AdWords API Team)

unread,
Jun 14, 2018, 5:14:05 AM6/14/18
to AdWords API and Google Ads API Forum
Hi,

To further investigate this, could you provide the complete SOAP request and response logs when you encountered the issue together with you clientCusotmerId? Please reply via Reply privately to author.

Thanks and regards,
Luis
AdWords API Team

V54328u

unread,
Jun 14, 2018, 6:30:03 AM6/14/18
to AdWords API and Google Ads API Forum
 image.setData(com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl("
https://goo.gl/dEvQeF"));
  
// Upload image.  
com.google.api.ads.adwords.axis.v201802.cm.Image uploadedImage = (com.google.api.ads.adwords.axis.v201802.cm.Image) mediaService.upload(new com.google.api.ads.adwords.axis.v201802.cm.Media[] {image})[0];
    
when it comes to part of "upload image", that is the time it gives error as NullError.NULL_CONTENT @ media[0].data

Luis Xander Talag (AdWords API Team)

unread,
Jun 14, 2018, 11:21:07 PM6/14/18
to adwor...@googlegroups.com
Hi,

Thank you for providing the logs. Upon replicating on my end using the same image URL (
https://goo.gl/dEvQeF) and also I tried the code snippet you provided (mediaService.upload), I was able to successfully upload the image on my end. See the attached file for my SOAP logs. Based on your response, I noticed that attribute for <ns2:data/> has no value. This being said, the image was not able to read by the mediaService.upload(). The possible problem must be somewhere on your line of codes. I would suggest to double check your codes and you may compare it to this sample code for uploading the image. If the issue persist, could you provide the class you used in uploading the image 
(reply privately to author) so I could further investigate this.

Regards,
Luis
AdWords API Team
upload_image.txt
Reply all
Reply to author
Forward
0 new messages