Hello!

I'm having some issues when i try to get the audiences data from API.
The code I'm using is:

from google.ads.googleads.client import GoogleAdsClient

client_g = GoogleAdsClient.load_from_storage(version="v9") 
ga_service = client_g.get_service("GoogleAdsService")
client_customer_id = 'my great ID'

query = """
       SELECT
          audience.id,
          audience.resource_name,
          audience.name,
          audience.status,
          audience.description,
          audience.dimensions,
          audience.exclusion_dimension
        FROM audience
    """ 

search_request = client_g.get_type("SearchGoogleAdsStreamRequest")
search_request.customer_id = client_customer_id
search_request.query = query
stream = ga_service.search_stream(search_request)

ERROR: Request made:, Host: googleads.googleapis.com, Method: 
/google.ads.googleads.v9.services.GoogleAdsService/SearchStream,, IsFault: 
True, FaultMessage: Unrecognized fields in the query: 
'audience.exclusion_dimension', 'audience.status', 'audience.dimensions', 
'audience.description', 'audience.resource_name', 'audience.id', 
'audience.name'.

This variable query I've found here:  
https://developers.google.com/google-ads/api/docs/remarketing/audiences

And the example of the code here:
https://developers.google.com/google-ads/api/docs/reporting/streaming

What I don't understand is: if I've found all this in the documentation, it 
supposed to work, not fail. And I tried to run with 'campaign', 'adgroup' 
instead of 'audience' and it worked. What should I do?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a1e35bb6-fddc-4dae-b79f-c67664c86310n%40googlegroups.com.
  • Ge... João Pedro
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to