Hi, I want to get my marketing report of google ads.

So I installed google api library in my computer.

And then I input my oauth json file, run generate_report.py.

But I got an error.

How can I solve it?

%run -i generate_report.py
--------------------------------------------------------------------------- 
KeyError Traceback (most recent call last) 
File E:\@@@@\generate_report.py:176, in <module> 

      170    print('The credentials have been revoked or expired, please 
delete the ' 
      171              '"%s" file and re-run the application to 
re-authorize.' % 
      172              CREDENTIALS_FILE) 
      175 if __name__ == '__main__': 
--> 176   main(sys.argv) 

File E:\ @@@@  \generate_report.py:134, in main(argv) 
      131 with discovery.build('adsense', 'v2', credentials = credentials) 
as service: 
      132   try: 
      133     # Let the user pick account if more than one.
--> 134     account_id = get_account_id(service) 
      136     # Retrieve report. 
      137     if saved_report_id: 

File E:\ @@@@  \generate_report.py:51, in get_account_id(service) 
      49 account_id = None 
      50 response = service.accounts().list().execute() 
---> 51 if len(response['accounts']) == 1: 
      52 account_id = response['accounts'][0]['name'] 
      53 else: 

KeyError: 'accounts'

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/6f9bf2a2-bd7a-473b-80cd-900962a1dccdn%40googlegroups.com.
  • Ke... A Choe
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to