REST Resource: properties
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:Property
附加至應用程式公開或私人檔案的鍵/值組合。
下列限制適用於檔案屬性:
- 每個檔案最多可包含 100 個屬性
- 每個應用程式的私人資源數量上限為 30 個
- 最多 30 個公開資源
- 單一資源的 UTF-8 編碼 (鍵 + 值) 字串大小上限為 124 個位元組
部分資源方法 (例如 properties.update
) 需要 propertyKey
。使用 properties.list
方法擷取屬性的鍵。
JSON 表示法 |
{
"selfLink": string,
"value": string,
"visibility": string,
"kind": string,
"etag": string,
"key": string
} |
欄位 |
selfLink |
string
僅供輸出。連回此房源的連結。
|
value |
string
這個屬性的值。
|
visibility |
string
此屬性的瀏覽權限。允許的值為 PRIVATE (預設) 和 PUBLIC。您只能使用已驗證的請求擷取私人資源。經過驗證的要求會使用透過 OAuth 2 用戶端 ID 取得的存取權杖。您無法使用 API 金鑰擷取私人資源。
|
kind |
string
僅供輸出。這個值一律為 drive#property 。
|
etag |
string
僅供輸出。房源的 ETag。
|
key |
string
這個屬性的鍵。
|
方法 |
|
刪除資源。 |
|
根據索引鍵取得資源。 |
|
將屬性新增至檔案,或更新現有的屬性。 |
|
列出檔案的屬性。 |
|
更新屬性。 |
|
更新屬性。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# REST Resource: properties\n\n- [Resource: Property](#Property)\n - [JSON representation](#Property.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Property\n------------------\n\nA key-value pair attached to a file that is either public or private to an application.\n\nThe following limits apply to file properties:\n\n- Maximum of 100 properties total per file\n- Maximum of 30 private properties per app\n- Maximum of 30 public properties\n- Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property\n\nSome resource methods (such as `properties.update`) require a `propertyKey`. Use the `properties.list` method to retrieve the key for a property.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------|\n| ``` { \"selfLink\": string, \"value\": string, \"visibility\": string, \"kind\": string, \"etag\": string, \"key\": string } ``` |\n\n| Fields ||\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `selfLink` | `string` Output only. The link back to this property. |\n| `value` | `string` The value of this property. |\n| `visibility` | `string` The visibility of this property. Allowed values are PRIVATE (default) and PUBLIC. Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. |\n| `kind` | `string` Output only. This is always `drive#property`. |\n| `etag` | `string` Output only. ETag of the property. |\n| `key` | `string` The key of this property. |\n\n| Methods ------- ||\n|------------------------------------------------------------------------|----------------------------------------------------------------|\n| ### [delete](/workspace/drive/api/reference/rest/v2/properties/delete) | Deletes a property. |\n| ### [get](/workspace/drive/api/reference/rest/v2/properties/get) | Gets a property by its key. |\n| ### [insert](/workspace/drive/api/reference/rest/v2/properties/insert) | Adds a property to a file, or updates it if it already exists. |\n| ### [list](/workspace/drive/api/reference/rest/v2/properties/list) | Lists a file's properties. |\n| ### [patch](/workspace/drive/api/reference/rest/v2/properties/patch) | Updates a property. |\n| ### [update](/workspace/drive/api/reference/rest/v2/properties/update) | Updates a property. |"]]