Hi Jing,

According to our optional request headers guide, when using any optional fields 
on a request method, the request message must be constructed outside of the 
method and passed in as a single parameter. Only the fields  fields that 
contain the annotation [(google.api.field_behavior) = REQUIRED] can be added as 
keywords. In ad_group_ad_service.proto, response_content_type isn't a required 
field. You can try editing add_responsive_search_ad.py to add optional request 
headers like this:

request = client.get_type("MutateAdGroupAdsRequest")
request.customer_id = customer_id
request.operations = [ad_group_ad_operation]
request.response_content_type = "MUTABLE_RESOURCE"
# Send a request to the server to add a responsive search ad.
ad_group_ad_response = ad_group_ad_service.mutate_ad_group_ads(
request = request
)

instead of this:

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

​​​​​​​I tried it and it worked. Feel free to get back to us.

Regards,


Aryeh Baker
Google Ads API Team
ref:_00D1U1174p._5004Q2TnhVU:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/dUutJ000000000000000000000000000000000000000000000R5730H00Pqyy01QYQhKz_CdCaxPVaA%40sfdc.net.
  • mu... Jing CHEN
    • ... 'Google Ads API Forum Advisor' via AdWords API and Google Ads API Forum
    • ... Mhmoudahmdmohmmd homydt

Reply via email to