I have successfully created a MediaFile within the account and am trying to 
use that to create a Display ad (non-HTML5), but when running this function 
I receive the below error:

    def create_display_upload_ad_group_ads(self, ad_group_id, customer_id):

        ad_group_ad_operation = client.get_type("AdGroupAdOperation")
        ad_group_ad_service = client.get_service("AdGroupAdService")
        # Configure the ad group ad fields.
        ad_group_ad = ad_group_ad_operation.create
        ad_group_ad.status = client.enums.AdGroupAdStatusEnum.ENABLED
        ad_group_ad.ad_group = 
client.get_service("AdGroupService").ad_group_path(
            self.customer_id, self.ad_group_id
        )

        # Configured the ad as a display ad.
        display_ad = ad_group_ad.ad
        display_ad.name = 'Ad Name'
        display_ad.final_urls.append(self.landing_page)
        display_ad.display_url = 'digible.com'
        display_ad.image_ad.media_file = 
"customers/3727734182/mediaFiles/156598151473"

        ad_group_ad_service.mutate_ad_group_ads(
            customer_id=customer_id, operations=[ad_group_ad_operation]
        )

ERROR Recieved:
Request with ID "5baQ0V9cGCiQ5jFaPaRfyg" failed with status 
"INVALID_ARGUMENT" and includes the following errors:
Error with message "The image is not of legal dimensions.".
On field: operations
On field: create
On field: ad
On field: image_ad
On field: media_file

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/67524a4b-5e48-4e71-90ce-65e93be81c4fn%40googlegroups.com.
  • Cr... Adam Walters
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Adam Walters
        • ... Adam Walters

Reply via email to