"The required field was not present" error message

35 views
Skip to first unread message

주식회사노먼

unread,
Sep 19, 2025, 6:55:16 AM (5 days ago) Sep 19
to Google Ads API and AdWords API Forum

Hello,

I have been using the Google Ads API to create ads, but over the past two days, ad creation has started failing.

In my Google Ads account, I have marked that the campaign does not contain EU political advertising.

However, when creating ads via the API, I am receiving the following error message:
"The required field was not present"

I am currently using API version v21.

Does anyone know what might be causing this issue?

Thank you in advance for your help. 

Google Ads API Forum Advisor

unread,
Sep 19, 2025, 7:42:31 AM (5 days ago) Sep 19
to oper...@naver.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team. 

Based on the information provided, I understand that you are encountering an error message stating 'The required field was not present'. This clearly indicates you are missing one of the required fields while creating an ad using the Google Ads API. We need to have your complete request of what you are passing in order to find which field you are missing. In order to investigate your issue further, kindly provide us with the complete API logs (request and response logs with request-id and request header) generated at your end to better assist you further. 

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-09-19 11:41:39Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01u73zq:ref" (ADR-00333219)



feng chen

unread,
3:32 PM (8 hours ago) 3:32 PM
to Google Ads API and AdWords API Forum
def create_campaign(
client: GoogleAdsClient, customer_id: str, campaign_budget: str
) -> str:
"""Creates campaign resource.

Args:
client: an initialized GoogleAdsClient instance.
customer_id: a client customer ID.
campaign_budget: a budget resource name.

Returns:
Campaign resource name.
"""
campaign_service: CampaignServiceClient = client.get_service(
"CampaignService"
)
campaign_operation: CampaignOperation = client.get_type("CampaignOperation")
campaign: Campaign = campaign_operation.create
campaign.name = f"Testing RSA via API {uuid.uuid4()}"
campaign.advertising_channel_type = (
client.enums.AdvertisingChannelTypeEnum.SEARCH
)

# Recommendation: Set the campaign to PAUSED when creating it to prevent
# the ads from immediately serving. Set to ENABLED once you've added
# targeting and the ads are ready to serve.
campaign.status = client.enums.CampaignStatusEnum.PAUSED

# Set the bidding strategy and budget.
# The bidding strategy for Maximize Clicks is TargetSpend.
# The target_spend_micros is deprecated so don't put any value.
# See other bidding strategies you can select in the link below.
# https://developers.google.com/google-ads/api/reference/rpc/latest/Campaign#campaign_bidding_strategy
campaign.target_spend.target_spend_micros = 0
campaign.campaign_budget = campaign_budget

# Set the campaign network options.
campaign.network_settings.target_google_search = True
campaign.network_settings.target_search_network = True
campaign.network_settings.target_partner_search_network = False
# Enable Display Expansion on Search campaigns. For more details see:
# https://support.google.com/google-ads/answer/7193800
campaign.network_settings.target_content_network = True

# # Optional: Set the start date.
# start_time = datetime.date.today() + datetime.timedelta(days=1)
# campaign.start_date = datetime.date.strftime(start_time, _DATE_FORMAT)

# # Optional: Set the end date.
# end_time = start_time + datetime.timedelta(weeks=4)
# campaign.end_date = datetime.date.strftime(end_time, _DATE_FORMAT)

# Add the campaign.
campaign_response: MutateCampaignsResponse = (
campaign_service.mutate_campaigns(
customer_id=customer_id, operations=[campaign_operation]
)
)
resource_name: str = campaign_response.results[0].resource_name
print(f"Created campaign {resource_name}.")
return resource_name

The above is my code, which I copied from the official documentation, but encountered an error when executed FaultMessage: The required field was not present

Google Ads API Forum Advisor

unread,
5:31 PM (6 hours ago) 5:31 PM
to adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Note that versions v19.2, v20.1, and v21 of the API contain a new field named contains_eu_political_advertising in the Campaign object. This field indicates whether your campaign contains political advertising content targeted towards the European Union.

If this field is set to CONTAINS_EU_POLITICAL_ADVERTISING, the campaign will no longer serve in the EU starting September 22, 2025. API calls to create a new campaign will fail with a FieldError.REQUIRED error if this field is not set. For more details, refer to this release notes and blog post

I would suggest you refer to this sample code to create a search campaign and to know how to add the field "CONTAINS_EU_POLITICAL_ADVERTISING". 

If you encounter any issues even after following the above suggestions, please share the latest complete API logs (request and response with request-id and request header) generated at your end.


If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. 

You can send the details via Reply privately to the author option, or direct private reply to this email.

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-09-23 21:30:29Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01u7N3i:ref" (ADR-00333531)



Reply all
Reply to author
Forward
0 new messages