適用於 Java 的 Google Ads API 用戶端程式庫
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Java 適用的用戶端程式庫託管於 GitHub,並透過 Maven 發布。這個程式庫提供多項功能,可協助您使用 API,包括簡化憑證管理作業,以及建立 Google Ads API 服務用戶端。
這個程式庫需要 Java 1.8 以上版本。
video_library
影片庫:開始使用 Java 用戶端程式庫
指南
- 開始使用
- 程式庫的設定說明。
- 授權
說明如何使用不同的授權流程,為程式庫設定 OAuth2 憑證。
- OAuth 電腦應用程式流程
- 如何取得電腦版應用程式的 OAuth2 更新權杖。
- OAuth 網頁應用程式流程
- 如何取得網頁應用程式的 OAuth2 更新權杖。
- OAuth 服務帳戶流程
- 如何搭配服務帳戶憑證使用 OAuth2。
- 從原始碼開始建構
如何從來源建構用戶端程式庫。
- 設定檔格式
如何指定 Java 屬性。
- Logging
如何設定記錄功能。
- 欄位遮罩
如何在更新作業中使用欄位遮罩。
- 資源名稱
API 中的資源名稱格式和用法。
- Proxy 設定
設定 HTTP(S) Proxy。
- 長期執行的作業
執行長時間執行的作業。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-26 (世界標準時間)。
[null,null,["上次更新時間:2025-08-26 (世界標準時間)。"],[[["\u003cp\u003eThe Google Ads API client library for Java is open-source, available on GitHub, and distributed via Maven for easy integration into your projects.\u003c/p\u003e\n"],["\u003cp\u003eIt simplifies interactions with the Google Ads API, offering features like credential management and service client creation, while requiring Java 1.8+ for compatibility.\u003c/p\u003e\n"],["\u003cp\u003eComprehensive guides and documentation are available to assist with setup, authorization using various OAuth flows, building from source, and other library functionalities.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage resources for advanced usage including configuration files, logging, field masks, resource names, proxy settings, and managing long-running operations.\u003c/p\u003e\n"],["\u003cp\u003eA dedicated video library provides a visual guide to get started with the Java client library and its core features.\u003c/p\u003e\n"]]],[],null,["# Google Ads API Client Library for Java\n\nThe client library for Java is [hosted on\nGitHub](https://github.com/googleads/google-ads-java) and\n[distributed](//search.maven.org/artifact/com.google.api-ads/google-ads)\nthrough [Maven](//maven.apache.org/). It offers several features to help you use\nthe API, including easier management of credentials and creation of Google Ads API\nservice clients.\n\nThe library requires Java 1.8+.\n\n\nvideo_library\n[Video library: Getting started with the Java client library](https://www.youtube.com/playlist?list=PLKByxjzUC-N9gWKMqpi5S0WIVc4o_Ukdj)\n\nGuides\n------\n\n[Getting started](/google-ads/api/docs/client-libs/java/getting-started)\n: Setup instructions for the library.\n\nAuthorization\n\n: Instructions on configuring OAuth2 credentials for the library using\n different authorization flows.\n\n [OAuth desktop application flow](/google-ads/api/docs/client-libs/java/oauth-desktop)\n : How to get OAuth2 refresh tokens for desktop apps.\n\n [OAuth web application flow](/google-ads/api/docs/client-libs/java/oauth-web)\n : How to get OAuth2 refresh tokens for web apps.\n\n [OAuth service account flow](/google-ads/api/docs/client-libs/java/oauth-service)\n : How to use OAuth2 with service account credentials.\n\n[Build from source](/google-ads/api/docs/client-libs/java/build-from-source)\n\n: How to build the client library from source.\n\n[Configuration file format](/google-ads/api/docs/client-libs/java/config-file)\n\n: How to specify Java properties.\n\n[Logging](/google-ads/api/docs/client-libs/java/logging)\n\n: How to set up logging.\n\n[Field masks](/google-ads/api/docs/client-libs/java/field-masks)\n\n: How to use field masks in update operations.\n\n[Resource names](/google-ads/api/docs/client-libs/java/resource-names)\n\n: Form and usage of resource names in the API.\n\n[Proxy configuration](/google-ads/api/docs/client-libs/java/proxy)\n\n: Configure a HTTP(S) proxy.\n\n[Long-running operations](/google-ads/api/docs/client-libs/java/lro)\n\n: Run long-running operations."]]