Search Api Request Stop

43 views
Skip to first unread message

JIHoon Ock

unread,
Apr 21, 2024, 9:46:24 PM4/21/24
to Google Ads API and AdWords API Forum
Hello.

Your request was stopped while using the Google Search API.

No error occurred and logging was stopped.
If you try again, it's requested normally, but we need Batch every day.
I also used the timeout function, but it's not working properly. Was there anything I misused?


Code
====================================================================  client = GoogleAdsClient.load_from_dict(GOOGLE_CONFIG)
        client.login_customer_id = config.GOOGLE_LOGIN_CUSTOMER_ID

        ga_service = client.get_service("GoogleAdsService")

        query = f"""
                    SELECT ad_group.resource_name, ad_group.id, ad_group.name
                        , ad_group.status, ad_group.campaign
                        , campaign.id, campaign.name, campaign.start_date, campaign.end_date
                        , ad_group.type, ad_group.ad_rotation_mode, ad_group.display_custom_bid_dimension
                    FROM ad_group
                    WHERE campaign.start_date >= {LAST_WEEK}
                """

            for ad_account in ad_accounts:
                    request = client.get_type("SearchGoogleAdsRequest")
                    request.customer_id = ad_account.CUSTOMER_CLIENT_ID
                    request.query = query
                    # Call Google API after request setting
                    response = ga_service.search(request=request, retry=Retry(timeout=60))
====================================================================

Logging
====================================================================
Request
-------
Method: /google.ads.googleads.v15.services.GoogleAdsService/Search
Host: googleads.googleapis.com
Headers: {
  "developer-token": "REDACTED",
  "login-customer-id": "3988518378",
  "x-goog-api-client": "gl-python/3.9.18 grpc/1.60.0 gax/2.15.0 gccl/22.1.0 pb/4.23.4",
  "x-goog-request-params": "customer_id=2089577697"
}
Request: customer_id: "2089577697"
query: "\n                    SELECT ad_group.resource_name, ad_group.id, ad_group.name\n                        , ad_group.status, ad_group.campaign \n                        , campaign.id, campaign.name, campaign.start_date, campaign.end_date\n                        , ad_group.type, ad_group.ad_rotation_mode, ad_group.display_custom_bid_dimension\n                    FROM ad_group\n                    WHERE campaign.start_date >= 20240415\n                "


Response
-------
Headers: {
  "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
  "content-disposition": "attachment",
  "date": "Mon, 22 Apr 2024 00:43:18 GMT",
  "request-id": "7hAv080ovk4kQ2m2iKGqNQ"
}
Response: field_mask {
  paths: "ad_group.resource_name"
  paths: "ad_group.id"
  paths: "ad_group.name"
  paths: "ad_group.status"
  paths: "ad_group.campaign"
  paths: "campaign.id"
  paths: "campaign.name"
  paths: "campaign.start_date"
  paths: "campaign.end_date"
  paths: "ad_group.type"
  paths: "ad_group.ad_rotation_mode"
  paths: "ad_group.display_custom_bid_dimension"
}


Request made: ClientCustomerId: 2089577697, Host: googleads.googleapis.com, Method: /google.ads.googleads.v15.services.GoogleAdsService/Search, RequestId: 7hAv080ovk4kQ2m2iKGqNQ, IsFault: False, FaultMessage: None

<-- This is where logging stops, the process stops without ending.
=======================================================================

Thanks.

Google Ads API Forum Advisor

unread,
Apr 22, 2024, 6:42:46 AM4/22/24
to adwor...@googlegroups.com
Hi,

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

It's hard to determine the reason for this issue with the provided information. Note that I am able to execute the given query using the Google Ads search method without any issues. 

Could you confirm if you are still encountering the issue? If yes, kindly provide the complete implementation to assist you further.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02tPGi1:ref" (ADR-00231969)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages