Method: accounts.adUnits.list
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
GET https://admob.googleapis.com/v1beta/{parent=accounts/*}/adUnits
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
parent |
string
必要欄位。要列出其廣告單元的帳戶資源名稱。範例:accounts/pub-9876543210987654
|
查詢參數
參數 |
pageSize |
integer
要傳回的廣告單元數量上限。如果未指定或為 0,最多將傳回 10,000 個廣告單元。許可的最大值為 20,000;超過 20,000 個值將強制轉換為 20,000。
|
pageToken |
string
最後一個 ListAdUnitsResponse 傳回的值;表示這是之前的 adUnits.list 呼叫的接續,系統應傳回下一頁的資料。
|
回應主體
廣告單元清單請求的回應。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"adUnits": [
{
object (AdUnit )
}
],
"nextPageToken": string
} |
欄位 |
adUnits[] |
object (AdUnit )
指定帳戶所產生的廣告單元。
|
nextPageToken |
string
如果沒有空白,表示請求中可能還有其他廣告單元;這個值應在新的 ListAdUnitsRequest 中傳遞。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/admob.monetization
https://www.googleapis.com/auth/admob.readonly
詳情請參閱 OAuth 2.0 總覽。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-21 (世界標準時間)。
[null,null,["上次更新時間:2025-08-21 (世界標準時間)。"],[[["\u003cp\u003eThis page explains how to list ad units associated with a specific AdMob account using the \u003ccode\u003eadUnits.list\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe method requires the \u003ccode\u003eparent\u003c/code\u003e path parameter to specify the AdMob account and accepts optional \u003ccode\u003epageSize\u003c/code\u003e and \u003ccode\u003epageToken\u003c/code\u003e query parameters for pagination.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses provide a list of \u003ccode\u003eAdUnits\u003c/code\u003e and a \u003ccode\u003enextPageToken\u003c/code\u003e for retrieving additional pages if available.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is required using either \u003ccode\u003ehttps://www.googleapis.com/auth/admob.monetization\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/admob.readonly\u003c/code\u003e OAuth scopes.\u003c/p\u003e\n"]]],["This document details how to list ad units associated with a specific AdMob account. The process involves sending a `GET` request to `https://admob.googleapis.com/v1beta/{parent=accounts/*}/adUnits`, where `parent` is the account's resource name. Optional query parameters, `pageSize` (up to 20,000) and `pageToken` (for pagination), can be included. The request body must be empty. The response includes an array of `adUnits` and a `nextPageToken` for further results. Authorization requires specific OAuth scopes.\n"],null,["# Method: accounts.adUnits.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListAdUnitsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Examples](#examples)\n- [Try it!](#try-it)\n\nList the ad units under the specified AdMob account.\n\n### HTTP request\n\n`GET https://admob.googleapis.com/v1beta/{parent=accounts/*}/adUnits`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. Resource name of the account to list ad units for. Example: accounts/pub-9876543210987654 |\n\n### Query parameters\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pageSize` | `integer` The maximum number of ad units to return. If unspecified or 0, at most 10,000 ad units will be returned. The maximum value is 20,000; values above 20,000 will be coerced to 20,000. |\n| `pageToken` | `string` The value returned by the last `ListAdUnitsResponse`; indicates that this is a continuation of a prior `adUnits.list` call, and that the system should return the next page of data. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse for the ad units list request.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"adUnits\": [ { object (/admob/api/reference/rest/v1beta/accounts.adUnits#AdUnit) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------|\n| `adUnits[]` | `object (`[AdUnit](/admob/api/reference/rest/v1beta/accounts.adUnits#AdUnit)`)` The resulting ad units for the requested account. |\n| `nextPageToken` | `string` If not empty, indicates that there may be more ad units for the request; this value should be passed in a new `ListAdUnitsRequest`. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/admob.monetization`\n- `\n https://www.googleapis.com/auth/admob.readonly`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]