Getting an authorization error while trying to get list of advertiser
Opened this issue · 0 comments
We want to explore API route to get data from campaign manager portal.
- Created API Client - Downloaded creds json and enabled campaign manager API.
- Authenticated the user using authenticate_using_user_account.py
- 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'}]">