REST Resource: parents
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทรัพยากร: ParentReference
การอ้างอิงถึงไฟล์หลัก
ไฟล์มีโฟลเดอร์หลักได้เพียงโฟลเดอร์เดียว ระบบไม่รองรับการระบุโฟลเดอร์หลักหลายรายการ
วิธีการของทรัพยากรบางรายการ (เช่น parents.get
) ต้องใช้ parentId
ใช้เมธอด parents.list
เพื่อเรียกข้อมูลรหัสของผู้ปกครอง
การแสดง JSON |
{
"selfLink": string,
"id": string,
"isRoot": boolean,
"kind": string,
"parentLink": string
} |
ช่อง |
selfLink |
string
เอาต์พุตเท่านั้น ลิงก์กลับไปยังข้อมูลอ้างอิงนี้
|
id |
string
รหัสของรายการหลัก
|
isRoot |
boolean
เอาต์พุตเท่านั้น โฟลเดอร์ระดับบนสุดเป็นโฟลเดอร์รูทหรือไม่
|
kind |
string
เอาต์พุตเท่านั้น ค่านี้จะมีค่าเป็น drive#parentReference เสมอ
|
parentLink |
string
เอาต์พุตเท่านั้น ลิงก์ไปยังรายการหลัก
|
เมธอด |
|
นำผู้ปกครองออกจากไฟล์ |
|
รับการอ้างอิงระดับบนสุดที่เฉพาะเจาะจง |
|
เพิ่มโฟลเดอร์หลักสำหรับไฟล์ |
|
แสดงรายการไฟล์หลักของไฟล์ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# REST Resource: parents\n\n- [Resource: ParentReference](#ParentReference)\n - [JSON representation](#ParentReference.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: ParentReference\n-------------------------\n\nA reference to a file's parent.\n\nA file can only have one parent folder; specifying multiple parents isn't supported.\n\nSome resource methods (such as `parents.get`) require a `parentId`. Use the `parents.list` method to retrieve the ID for a parent.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------|\n| ``` { \"selfLink\": string, \"id\": string, \"isRoot\": boolean, \"kind\": string, \"parentLink\": string } ``` |\n\n| Fields ||\n|--------------|----------------------------------------------------------------------|\n| `selfLink` | `string` Output only. A link back to this reference. |\n| `id` | `string` The ID of the parent. |\n| `isRoot` | `boolean` Output only. Whether or not the parent is the root folder. |\n| `kind` | `string` Output only. This is always `drive#parentReference`. |\n| `parentLink` | `string` Output only. A link to the parent. |\n\n| Methods ------- ||\n|---------------------------------------------------------------------|-----------------------------------|\n| ### [delete](/workspace/drive/api/reference/rest/v2/parents/delete) | Removes a parent from a file. |\n| ### [get](/workspace/drive/api/reference/rest/v2/parents/get) | Gets a specific parent reference. |\n| ### [insert](/workspace/drive/api/reference/rest/v2/parents/insert) | Adds a parent folder for a file. |\n| ### [list](/workspace/drive/api/reference/rest/v2/parents/list) | Lists a file's parents. |"]]