Google Business Performance API 的
NEW API 方法可擷取單一 API 要求中的多個「DailyMetrics」。
請詳閱
淘汰時間表和從 v4 reportInsights API 方法遷移至 Google Business Profile Performance API 的操作說明。
Method: attributes.list
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
傳回特定主要類別和國家/地區的地點可用的屬性清單。
HTTP 要求
GET https://mybusiness.googleapis.com/v4/attributes
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
name |
string
用於查詢可用屬性的位置資源名稱。
|
categoryId |
string
主要類別固定 ID,用於尋找可用屬性。
|
country |
string
用於尋找可用屬性的 ISO 3166-1 alpha-2 國家/地區代碼。
|
languageCode |
string
要產生屬性顯示名稱的 BCP 47 語言代碼。如果無法使用這個語言,系統將以英文提供相關內容。
|
pageSize |
integer
每頁要加入的屬性數量。預設值為 200,最小值為 1。
|
pageToken |
string
如有指定,系統會擷取屬性中繼資料的下一頁。如果呼叫 attributes.list 傳回的結果超出要求的網頁大小,系統會傳回 pageToken 。
|
回應主體
如果成功,回應主體會含有以下結構的資料:
Locations.ListAttributeMetadata 的回應訊息。
JSON 表示法 |
{
"attributes": [
{
object (AttributeMetadata )
}
],
"nextPageToken": string
} |
欄位 |
attributes[] |
object (AttributeMetadata )
可用屬性的屬性中繼資料集合。
|
nextPageToken |
string
如果屬性數量超過要求的頁面大小,這個欄位就會填入符記,以便在後續呼叫 attributes.list 時擷取下一頁的屬性。如果沒有更多屬性,這個欄位就不會出現在回應中。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/plus.business.manage
https://www.googleapis.com/auth/business.manage
詳情請參閱 OAuth 2.0 總覽。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eLists available attributes for a Google Business Profile location based on primary category and country.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying location, category, and country; optional parameters include language and pagination controls.\u003c/p\u003e\n"],["\u003cp\u003eResponse provides attribute metadata and a token for retrieving additional pages if necessary.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific Google Business Profile management scopes.\u003c/p\u003e\n"]]],[],null,["# Method: attributes.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListAttributeMetadataResponse.SCHEMA_REPRESENTATION)\n- [Authorization Scopes](#body.aspect)\n\nReturns the list of available attributes that would be available for a location with the given primary category and country.\n\n### HTTP request\n\n`GET https://mybusiness.googleapis.com/v4/attributes`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Resource name of the location to look up available attributes. |\n| `categoryId` | `string` The primary category stable ID to find available attributes. |\n| `country` | `string` The ISO 3166-1 alpha-2 country code to find available attributes. |\n| `languageCode` | `string` The BCP 47 code of language to get attribute display names in. If this language is not available, they will be provided in English. |\n| `pageSize` | `integer` How many attributes to include per page. Default is 200, minimum is 1. |\n| `pageToken` | `string` If specified, the next page of attribute metadata is retrieved. The `pageToken` is returned when a call to `attributes.list` returns more results than can fit into the requested page size. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nResponse message for Locations.ListAttributeMetadata.\n\n| JSON representation ||\n|---------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"attributes\": [ { object (/my-business/reference/rest/v4/attributes#AttributeMetadata) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `attributes[]` | `object (`[AttributeMetadata](/my-business/reference/rest/v4/attributes#AttributeMetadata)`)` A collection of attribute metadata for the available attributes. |\n| `nextPageToken` | `string` If the number of attributes exceeded the requested page size, this field will be populated with a token to fetch the next page of attributes on a subsequent call to `attributes.list`. If there are no more attributes, this field will not be present in the response. |\n\n### Authorization Scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/plus.business.manage`\n- `https://www.googleapis.com/auth/business.manage`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]