Method: labels.get
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
รับป้ายกำกับตามชื่อทรัพยากร ดูข้อมูลเพิ่มเติมได้ที่ค้นหาป้ายกำกับ
ชื่อทรัพยากรอาจเป็นชื่อใดก็ได้ต่อไปนี้
labels/{id}
- ดู labels/{id}@latest
labels/{id}@latest
- รับการแก้ไขป้ายกำกับล่าสุด
labels/{id}@published
- รับการแก้ไขที่เผยแพร่ล่าสุดของป้ายกำกับ
labels/{id}@{revisionId}
- รับป้ายกำกับที่รหัสการแก้ไขที่ระบุ
คำขอ HTTP
GET https://drivelabels.googleapis.com/v2/{name=labels/*}
URL ใช้ไวยากรณ์การแปลงรหัส gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
name |
string
ต้องระบุ ชื่อทรัพยากรของป้ายกำกับ อาจเป็นอย่างใดอย่างหนึ่งต่อไปนี้
labels/{id} (เทียบเท่ากับ labels/{id}@latest)
labels/{id}@latest
labels/{id}@published
labels/{id}@{revisionId}
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
useAdminAccess |
boolean
ตั้งค่าเป็น true เพื่อใช้ข้อมูลเข้าสู่ระบบผู้ดูแลระบบของผู้ใช้ เซิร์ฟเวอร์จะยืนยันว่าผู้ใช้เป็นผู้ดูแลระบบของป้ายกำกับก่อนที่จะอนุญาตให้เข้าถึง
|
languageCode |
string
รหัสภาษา BCP-47 ที่จะใช้ในการประเมินป้ายกำกับฟิลด์ที่แปลแล้ว หากไม่ได้ระบุ ระบบจะใช้ค่าในภาษาที่กำหนดค่าเริ่มต้น
|
view |
enum (LabelView )
เมื่อระบุ ระบบจะแสดงเฉพาะฟิลด์บางรายการที่เป็นของมุมมองที่ระบุ
|
เนื้อความของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ Label
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth อย่างใดอย่างหนึ่งต่อไปนี้
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.labels.readonly
https://www.googleapis.com/auth/drive.admin.labels
https://www.googleapis.com/auth/drive.admin.labels.readonly
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-05 UTC
[null,null,["อัปเดตล่าสุด 2025-08-05 UTC"],[],[],null,["# Method: labels.get\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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nGet a label by its resource name. For more information, see [Search for labels](https://developers.google.com/workspace/drive/labels/guides/search-label).\n\nResource name may be any of:\n\n- `labels/{id}` - See `labels/{id}@latest`\n- `labels/{id}@latest` - Gets the latest revision of the label.\n- `labels/{id}@published` - Gets the current published revision of the label.\n- `labels/{id}@{revisionId}` - Gets the label at the specified revision ID.\n\n### HTTP request\n\n`GET https://drivelabels.googleapis.com/v2/{name=labels/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Label resource name. May be any of: - `labels/{id}` (equivalent to labels/{id}@latest) - `labels/{id}@latest` - `labels/{id}@published` - `labels/{id}@{revisionId}` |\n\n### Query parameters\n\n| Parameters ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `useAdminAccess` | `boolean` Set to `true` in order to use the user's admin credentials. The server verifies that the user is an admin for the label before allowing access. |\n| `languageCode` | `string` The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language are used. |\n| `view` | `enum (`[LabelView](/workspace/drive/labels/reference/rest/v2/LabelView)`)` When specified, only certain fields belonging to the indicated view are returned. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Label](/workspace/drive/labels/reference/rest/v2/labels#Label).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive.labels`\n- `\n https://www.googleapis.com/auth/drive.labels.readonly`\n- `\n https://www.googleapis.com/auth/drive.admin.labels`\n- `\n https://www.googleapis.com/auth/drive.admin.labels.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]