REST Resource: properties
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทรัพยากร: พร็อพเพอร์ตี้
คู่คีย์-ค่าที่แนบมากับไฟล์ที่เป็นแบบสาธารณะหรือแบบส่วนตัวสำหรับแอปพลิเคชัน
ขีดจํากัดต่อไปนี้มีผลกับพร็อพเพอร์ตี้ไฟล์
- ที่พักทั้งหมดสูงสุด 100 แห่งต่อไฟล์
- พร็อพเพอร์ตี้ส่วนตัวสูงสุด 30 รายการต่อแอป
- พร็อพเพอร์ตี้สาธารณะสูงสุด 30 รายการ
- ขีดจํากัดขนาดสูงสุด 124 ไบต์สำหรับสตริง (คีย์ + ค่า) ในการเข้ารหัส UTF-8 สําหรับพร็อพเพอร์ตี้เดียว
วิธีการของทรัพยากรบางรายการ (เช่น 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 คุณใช้คีย์ API เพื่อดึงข้อมูลพร็อพเพอร์ตี้ส่วนตัวไม่ได้
|
kind |
string
เอาต์พุตเท่านั้น ค่านี้จะมีค่าเป็น drive#property เสมอ
|
etag |
string
เอาต์พุตเท่านั้น ETag ของพร็อพเพอร์ตี้
|
key |
string
คีย์ของพร็อพเพอร์ตี้นี้
|
เมธอด |
|
ลบพร็อพเพอร์ตี้ |
|
รับพร็อพเพอร์ตี้ตามคีย์ |
|
เพิ่มพร็อพเพอร์ตี้ลงในไฟล์ หรืออัปเดตพร็อพเพอร์ตี้หากมีอยู่แล้ว |
|
แสดงรายการพร็อพเพอร์ตี้ของไฟล์ |
|
อัปเดตพร็อพเพอร์ตี้ |
|
อัปเดตพร็อพเพอร์ตี้ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],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. |"]]