Google Adword API使用generate_refresh_token.py

时间:2016-01-07 01:06:41

标签: python oauth-2.0 google-api google-authentication google-api-python-client

我按照这里的步骤: https://github.com/googleads/googleads-python-lib/wiki/Using-OAuth-2.0

  1. 登录google developers console
  2. 创建项目,然后创建凭据,然后获取客户端ID和客户端密钥
  3. 通过pip安装googleads并下载库:https://github.com/googleads/googleads-python-lib
  4. 在此示例文件中输入客户端ID和客户端密码:https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/authentication/generate_refresh_token.py

    CLIENT_ID =' xxxxxxx.apps.googleusercontent.com'

    CLIENT_SECRET =' xxxxxxxxxxxxxxxxx'

  5. 然后我运行generate_refresh_token.py

  6. 我收到以下错误消息:

    raise AttributeError('No client_id or client_secret specified.')
    AttributeError: No client_id or client_secret specified.
    

    我真的很陌生,请告诉我我错过了什么。谢谢

1 个答案:

答案 0 :(得分:0)

我建议您生成一个新的客户机密。它对我有用。