google ads api 报错集锦

@高效码农  July 9, 2021

一、google.auth.exceptions.RefreshError

报错信息:
google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant', 'error_description': 'Bad Request'})
原因:

refresh_token配置错误

解决方案:

获取授权后,还需要在控制台授权,一般refresh_token是以1//0eb7WfsPwOsAiCgYIARAAGA4SNwF开头的

二、503 failed to connect to all addresses

报错信息:
google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses
原因:

这个应该是API的BUG,无论代理用http还是https都会报错

解决方案:

在配置文件中添加配置如下:

endpoint: googleads.googleapis.com:443



评论已关闭