Error occurred at MediaFileOperation create

38 views
Skip to first unread message

Venkat

unread,
May 11, 2019, 1:08:31 PM5/11/19
to AdWords API and Google Ads API Forum

I tried to make a MediaFile using MediaFileService but failing repeatedly.

    media_file_service = client.get_service('MediaFileService', version='v1')

    # create media file
    media_file_operation = client.get_type('MediaFileOperation', version='v1')
    media_file = media_file_operation.create
    media_file.name.value = 'Bugs bunny'
    media_file.source_url.value = 'http://cdn.zzz.com'
    media_file.type = client.get_type('MediaTypeEnum', version='v1').DYNAMIC_IMAGE
    media_file.mime_type = client.get_type('MimeTypeEnum', version='v1').IMAGE_GIF
    with open('candy_1.gif', 'rb') as fp:
        data = fp.read()
        media_file.image.data.value = bytes(data)
    try:
        media_file_response = media_file_service.mutate_media_files(
            customer_id, [media_file_operation])
    except GoogleAdsException as ex:
        print('Request with ID "%s" failed with status "%s" and includes the '
              'following errors:' % (ex.request_id, ex.error.code().name))
        for error in ex.failure.errors:
            print('\tError with message "%s".' % error.message)
            if error.location:
                for field_path_element in error.location.field_path_elements:
                    print('\t\tOn field: %s' % field_path_element.field_name)
        sys.exit(1)

Above is the code that I implemented. I did this as mentioned in the documentation. But not sure why this error has occurred.

Request with ID "masked" failed with status "INVALID_ARGUMENT" and includes the following errors:
Error with message "A required field was not specified or is an empty string.".
		On field: operations

Above is the error response I got.

Thanks.

googleadsapi...@google.com

unread,
May 13, 2019, 6:07:30 PM5/13/19
to AdWords API and Google Ads API Forum
Hello Venkat,

Looks like the Image field is not set to the MediaFile. Could you please follow the code pattern shown here in Java to upload images and the code samples in other languages can be found here. Please let me know if you have any further questions.

Regards,
Sai Teja, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Venkat

unread,
May 14, 2019, 5:06:41 AM5/14/19
to AdWords API and Google Ads API Forum
Hello,

The above code works with JPEG image but failing with GIF image. I already post the same question at client library, they replied with Unfortunately that appears to be an issue with the API and not the client library, would you please submit your question on the support forum?. Please help me with this.

Thanks.

googleadsapi...@google.com

unread,
May 14, 2019, 6:18:08 PM5/14/19
to venkat...@gmail.com, AdWords API and Google Ads API Forum
Hi,

From my investigation so far, it appears that the Google Ads API currently only supports uploads for ICON and IMAGE, not DYNAMIC_IMAGE. However, I'm confirming this with the team and will get back to you with an update.

Thanks,
Josh, Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/1ea73c2e-5392-4b80-9dd5-e2550597b1f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Venkat

unread,
May 15, 2019, 5:59:19 AM5/15/19
to AdWords API and Google Ads API Forum
Thanks Josh, I will be waiting for your update..


On Wednesday, May 15, 2019 at 3:48:08 AM UTC+5:30, googleadsapi-forumadvisor wrote:
Hi,

From my investigation so far, it appears that the Google Ads API currently only supports uploads for ICON and IMAGE, not DYNAMIC_IMAGE. However, I'm confirming this with the team and will get back to you with an update.

Thanks,
Josh, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Venkat

unread,
May 29, 2019, 8:23:00 AM5/29/19
to AdWords API and Google Ads API Forum
Any updates on this?

revarasi Sofa

unread,
May 29, 2019, 8:28:47 AM5/29/19
to venkat...@gmail.com, AdWords API and Google Ads API Forum
Service korsi sopa bandung

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to

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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.

Venkat

unread,
May 29, 2019, 8:54:15 AM5/29/19
to AdWords API and Google Ads API Forum
I didn't get you. can you please keep it in english?


On Saturday, May 11, 2019 at 10:38:31 PM UTC+5:30, Venkat wrote:

Google Ads API Forum Advisor Prod

unread,
May 30, 2019, 12:06:19 PM5/30/19
to venkat...@gmail.com, adwor...@googlegroups.com
Hi,

So far I've determined that we don't actually support uploading dynamic images, but the Google Ads API does support retrieving dynamic images from an account. I have a question out to the team and will update this thread if they provide additional information.

Thanks,
Josh, Google Ads API Team

ref:_00D1U1174p._5001UAqxhT:ref
Message has been deleted

Venkat

unread,
Jun 12, 2019, 7:27:41 AM6/12/19
to AdWords API and Google Ads API Forum
Thanks for the update.
Reply all
Reply to author
Forward
0 new messages