如何解决计算引擎请求的DCM / DFA API的身份验证范围不足
我一直在尝试使用Google的DCM / DFA报表API示例:
https://github.com/googleads/googleads-dfa-reporting-samples/tree/master/python/v3_4
我可以在自己的计算机上从那里运行文件而没有问题,但是当我尝试使用计算引擎运行它们时,它们似乎无法工作。我的计算机和计算引擎都遵循相同的过程,但仍然没有。
当我尝试在计算引擎上运行create_report.py文件时,出现错误消息:
<HttpError 403 when requesting https://dfareporting.googleapis.com/dfareporting/v3.4/userprofiles/5642832/reports/compatiblefields/query?alt=json returned "Request had insufficient authentication scopes.">
该链接返回以下消息:
{
"error": {
"code": 401,"message": "Request is missing required authentication credential. Expected OAuth 2 access token,login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","errors": [
{
"message": "Login Required.","domain": "global","reason": "required","location": "Authorization","locationType": "header"
}
],"status": "UNAUTHENTICATED"
}
}
我为我的项目启用了DCM / DFA报告和广告投放管理API。
我已经设置了oauth同意屏幕,并为我的代码提供了正确的oauth客户端凭据
我已授予我的计算引擎完全访问云API范围的权限
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。