googleads-dfa-reporting-samples icon indicating copy to clipboard operation
googleads-dfa-reporting-samples copied to clipboard

Getting an authorization error while trying to get list of advertiser

Open MrugankMJ opened this issue 6 months ago • 0 comments

We want to explore API route to get data from campaign manager portal.

  1. Created API Client - Downloaded creds json and enabled campaign manager API.
  2. Authenticated the user using authenticate_using_user_account.py
  3. Tried running - get_advertiser.py using the profile ID that has admin level access in CM360.

Also this works on API Explorer on the official documentation.

PS: I am downloading the files that I need locally and triggering the code.

Error Log

Traceback (most recent call last): File "get_advertisers.py", line 67, in main(sys.argv) File "get_advertisers.py", line 50, in main response = request.execute() File "C:\Users\g696150\PycharmProjects\Mrugank_Testpad\venv\lib\site-packages\googleapiclient_helpers.py", line 130, in positional_wrapper return wrapped(*args, **kwargs) File "C:\Users\g696150\PycharmProjects\Mrugank_Testpad\venv\lib\site-packages\googleapiclient\http.py", line 938, in execute raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: <HttpError 403 when requesting https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/1822640/advertisers?alt=json returned "Request had insufficient authentication scopes.". Details: "[{'message': 'Insufficient Permission', 'domain': 'global', 'reason': 'insufficientPermissions'}]">

MrugankMJ avatar Aug 05 '24 12:08 MrugankMJ