有兴趣分享您对 Google Ads API 的反馈吗?
注册即可获邀参与用户调研!
OAuth 服务账号流程
本指南将详细介绍如何使用服务账号设置 OAuth2,以便使用您自己的凭据访问 API。除非您撤消或删除 OAuth2 凭据,否则这些步骤只需执行一次。
创建 OAuth2 凭据
按照链接中的说明生成服务账号 ID 和 *.JSON 文件,然后返回此页面。
使用 JSON 文件设置客户端库
在 google_ads_php.ini
中配置以下键。如需了解详情,请参阅配置指南。
; For service account flow.
jsonKeyFilePath = "path/to/your/oauth2/key/file.json"
scopes = "https://www.googleapis.com/auth/adwords"
impersonatedEmail = "impersonated.account@email.com"
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-10。
[null,null,["最后更新时间 (UTC):2024-11-10。"],[[["This guide explains how to set up OAuth2 for Google Ads API access using service accounts with your own credentials."],["You'll need a Google Workspace domain and a service account with domain-wide delegation access granted by a super administrator."],["Setup involves generating a service account ID and JSON file, then configuring your client library with the file's path, scopes, and impersonated email."]]],[]]