Method: labels.get
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mendapatkan label berdasarkan nama resource-nya. Untuk mengetahui informasi selengkapnya, lihat Menelusuri label.
Nama resource dapat berupa salah satu dari:
labels/{id}
- Lihat labels/{id}@latest
labels/{id}@latest
- Mendapatkan revisi terbaru label.
labels/{id}@published
- Mendapatkan revisi label yang saat ini dipublikasikan.
labels/{id}@{revisionId}
- Mendapatkan label pada ID revisi yang ditentukan.
Permintaan HTTP
GET https://drivelabels.googleapis.com/v2/{name=labels/*}
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
name |
string
Wajib. Nama resource label. Dapat berupa salah satu dari:
labels/{id} (setara dengan labels/{id}@latest)
labels/{id}@latest
labels/{id}@published
labels/{id}@{revisionId}
|
Parameter kueri
Parameter |
useAdminAccess |
boolean
Setel ke true untuk menggunakan kredensial admin pengguna. Server memverifikasi bahwa pengguna adalah admin untuk label sebelum mengizinkan akses.
|
languageCode |
string
Kode bahasa BCP-47 yang akan digunakan untuk mengevaluasi label kolom yang dilokalkan. Jika tidak ditentukan, nilai dalam bahasa yang dikonfigurasi default akan digunakan.
|
view |
enum (LabelView )
Jika ditentukan, hanya kolom tertentu yang termasuk dalam tampilan yang ditunjukkan yang akan ditampilkan.
|
Isi permintaan
Isi permintaan harus kosong.
Isi respons
Jika berhasil, isi respons memuat instance Label
.
Cakupan otorisasi
Memerlukan salah satu cakupan OAuth berikut:
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
Untuk mengetahui informasi selengkapnya, lihat Panduan otorisasi.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-05 UTC.
[null,null,["Terakhir diperbarui pada 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)."]]