Posts tagged with python

I am trying to make a call to Google Ads API to access campaign data in python. I have completed the following steps:

  1. Created a web app and enabled Google-Ads API
  2. Saved JSON file that contains client id and secret information
  3. Generated refresh token
  4. Updated google-ads yaml file based on the client id, client secret, refresh token, developer token and customer id

However when I try this:

from google.ads.googleads.client import GoogleAdsClient client = GoogleAdsClient.load_from_storage("google-ads.yaml") 

I get the error:

RefreshError: ('unauthorized_client')

I have rechecked for any typos or white-spaces. I have the "Standard Access" on my email id: on Google-Ads account under the Access and Security section. Any help would be really great.

I'm trying to make a call to the Google ADS API through the ga_service.search_stream(my_query) method using the client.get_service("GoogleAdsService"). However i'm getting the error: " Version v10 is deprecated. Requests to this version will be blocked."

I run the print(google.ads.googleads.VERSION) code and I get the response that the installed version is v16.0.0 however I passed the version to GoogleAdsClient like this: GoogleAdsClient.load_from_storage("my_file.yaml", version=" v16")

In response I got the following error: Specified Google Ads API version "v16" does not exist. Valid API versions are: "v10", "v9"

I made the same call to the method GoogleAdsClient.load_from_storage("my_file.yaml", version=" v10") and GoogleAdsClient.load_from_storage("my_file.yaml", version=" v9")

I made the same call to the method GoogleAdsClient.load_from_storage("my_file.yaml", version=" v10") and got response: Version v10 is deprecated. Requests to this version will be blocked."

When I run GoogleAdsClient.load_from_storage("my_file.yaml", version=" v9") I get the response: google.api_core.exceptions.MethodNotImplemented: 501 GRPC target method can't be resolved

Can you help me? This issue may be associated with settings on the GoogleAds platform?

We use a python script to connect to Google Ads API and consume its REST operations.

All of a sudden the working script has started giving error with below message:

from google.ads.googleads.v10.enums.types import offline_user_data_job_status ModuleNotFoundError: No module named 'google.ads.googleads.v10' 

Please advise.