想分享對 Google Ads API 的意見嗎?
立即註冊,等待受邀參與使用者研究調查!
OAuth 服務帳戶流程
本指南將逐步說明如何使用服務帳戶,使用您自己的憑證設定 API 存取的 OAuth2。除非您撤銷或刪除 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"
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-10 (世界標準時間)。
[null,null,["上次更新時間: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."]]],[]]