Can't use the Google Ads Query Builder to get shopping_product

80 views
Skip to first unread message

lielai yun

unread,
Sep 13, 2024, 5:37:25 AM9/13/24
to Google Ads API and AdWords API Forum
When i use JDKV16.30  the  Google Ads Query Builder SQL :
SELECT campaign.name FROM shopping_product ;
The  query response
 Failure message: errors {
  error_code {
    query_error: BAD_RESOURCE_TYPE_IN_FROM_CLAUSE
  }
  message: "Error in shopping_product:  is not a valid resource name."
}

The api query details :

Request
-------
MethodName: google.ads.googleads.v16.services.GoogleAdsService/SearchStream
Headers: {developer-token=REDACTED, login-customer-id=XXX, x-goog-api-client=gl-java/11.0.1__Oracle-Corporation__18.9 gccl/30.0.0 gapic/30.0.0 gax/2.45.0 grpc/1.55.1}
Body: customer_id: "XXXXX"
query"SELECT campaign.name FROM shopping_product"

Response
--------
Headers: Metadata(content-type=application/grpc,request-id=lVNU0maMnVETOhPxCxsWvA,date=Fri, 13 Sep 2024 06:33:29 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; ma=2592000)
Body: null
Failure message: errors {
  error_code {
    query_error: BAD_RESOURCE_TYPE_IN_FROM_CLAUSE
  }
  message: "Error in shopping_product:  is not a valid resource name."
}
request_id: "lVNU0maMnVETOhPxCxsWvA"

Status: Status{code=INVALID_ARGUMENT, description=Request contains an invalid argument., cause=null}.
Request ID lVNU0maMnVETOhPxCxsWvA failed due to GoogleAdsException. Underlying errors:
  Error 0: error_code {
  query_error: BAD_RESOURCE_TYPE_IN_FROM_CLAUSE
}
message: "Error in shopping_product:  is not a valid resource name."


What's the problem? I'm looking forward to your reply.

Google Ads API Forum Advisor

unread,
Sep 13, 2024, 11:01:34 AM9/13/24
to yunlie...@gmail.com, adwor...@googlegroups.com
Hi,

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

By reviewing your concern, I understand that you are encountering a "BAD_RESOURCE_TYPE_IN_FROM_CLAUSE" error. To investigate this issue further, provide us with the complete API request without any fields being redacted (e.g., XXXXX) 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.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vG6uX:ref" (ADR-00268082)

Thanks,
 
Google Logo Google Ads API Team


Jurre van de Gevel

unread,
Sep 27, 2024, 8:27:21 AM9/27/24
to Google Ads API and AdWords API Forum
I have the same problem. Constantly getting the error: Request made: ClientCustomerId: xx, Host: googleads.googleapis.com, Method: /google.ads.googleads.v16.services.GoogleAdsService/SearchStream, , IsFault: True, FaultMessage: Unrecognized field in the query: 'shopping_product.resource_name'.

    query = """SELECT
            shopping_product.resource_name
            FROM shopping_product
            """

Google Ads API Forum Advisor

unread,
Sep 27, 2024, 12:34:23 PM9/27/24
to ju...@shopforward.eu, adwor...@googlegroups.com
Hi,

Can you provide the error message of what you are getting while making the API request? The query which you provided is valid and it returns the results. Also, can you confirm if you are passing the same query which was provided to us or adding any other fields in your API query. I would recommend you to refer to the 'Shopping Product' guide for more information as it helps of what fields are required to fetch the data. You can utilize the Google Ads Query Builder and Query Validator to build and validate the queries for retrieving the data from the Google Ads API. 

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 and uncropped UI screenshot of the Google Ads account (with visible customer ID) by highlighting the fields and metrics from where you are trying to retrieve the data from the Google Ads API. 
Reply all
Reply to author
Forward
0 new messages