একটি ফাইলের লেবেল তালিকা
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
আপনার প্রতিষ্ঠানের একাধিক লেবেল থাকতে পারে, লেবেলে যেকোন সংখ্যক ক্ষেত্র থাকতে পারে। এই পৃষ্ঠাটি বর্ণনা করে কিভাবে একটি একক Google ড্রাইভ ফাইলে সমস্ত লেবেল তালিকাভুক্ত করা যায়৷
ফাইল লেবেল তালিকা করতে, files.listLabels
পদ্ধতি ব্যবহার করুন। অনুরোধের বডি খালি হতে হবে। পদ্ধতিটি ঐচ্ছিক ক্যোয়ারী প্যারামিটার maxResults
ও নেয় প্রতি পৃষ্ঠায় ফেরত দিতে সর্বোচ্চ সংখ্যক লেবেল সেট করতে। সেট না থাকলে, 100টি ফলাফল ফেরত দেওয়া হয়।
সফল হলে, প্রতিক্রিয়া বডিতে একটি ফাইলে প্রয়োগ করা লেবেলের তালিকা থাকে। এগুলি Label
টাইপের একটি items
অবজেক্টের মধ্যে বিদ্যমান।
উদাহরণ
নিম্নলিখিত কোড নমুনা দেখায় কিভাবে সঠিক লেবেল পুনরুদ্ধার করতে লেবেলের fileId
ব্যবহার করতে হয়।
জাভা
List<Label> labelList =
labelsDriveClient.files().listLabels("FILE_ID").execute().getItems();
পাইথন
label_list_response = drive_service.files().listLabels(fileId="FILE_ID").execute();
Node.js
/**
* Lists all the labels on a Drive file
* @return{obj} a list of Labels
**/
async function listLabels() {
// Get credentials and build service
// TODO (developer) - Use appropriate auth mechanism for your app
const {GoogleAuth} = require('google-auth-library');
const {google} = require('googleapis');
const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'});
const service = google.drive({version: 'v3', auth});
try {
const labelListResponse = await service.files.listLabels({
fileId: 'FILE_ID',
});
return labelListResponse;
} catch (err) {
// TODO (developer) - Handle error
throw err;
}
}
আপনি যে ফাইলের জন্য লেবেলের তালিকা চান তার fileId
দিয়ে FILE_ID প্রতিস্থাপন করুন।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-04 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-04 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# List labels on a file\n\nYour organization can have multiple labels, with labels having any number of\nfields. This page describes how to list all labels on a single Google Drive\nfile.\n\nTo list the file labels, use the\n[`files.listLabels`](/workspace/drive/api/v2/reference/files/listLabels) method. The\nrequest body must be empty. The method also takes the optional query parameter\n`maxResults` to set the maximum number of labels to return per page. If not set,\n100 results are returned.\n\nIf successful, the [response\nbody](/workspace/drive/api/reference/rest/v2/files/listLabels#response-body) contains the\nlist of labels applied to a file. These exist within an `items` object of type\n[`Label`](/workspace/drive/api/reference/rest/v2/Label).\n\nExample\n-------\n\nThe following code sample shows how to use the label's `fileId` to retrieve the\ncorrect labels. \n\n### Java\n\n List\u003cLabel\u003e labelList =\n labelsDriveClient.files().listLabels(\"\u003cvar translate=\"no\"\u003eFILE_ID\u003c/var\u003e\").execute().getItems();\n\n### Python\n\n label_list_response = drive_service.files().listLabels(fileId=\"\u003cvar translate=\"no\"\u003eFILE_ID\u003c/var\u003e\").execute();\n\n### Node.js\n\n /**\n * Lists all the labels on a Drive file\n * @return{obj} a list of Labels\n **/\n async function listLabels() {\n // Get credentials and build service\n // TODO (developer) - Use appropriate auth mechanism for your app\n\n const {GoogleAuth} = require('google-auth-library');\n const {google} = require('googleapis');\n\n const auth = new GoogleAuth({scopes: 'https://www.googleapis.com/auth/drive'});\n const service = google.drive({version: 'v3', auth});\n try {\n const labelListResponse = await service.files.listLabels({\n fileId: '\u003cvar translate=\"no\"\u003eFILE_ID\u003c/var\u003e',\n });\n return labelListResponse;\n } catch (err) {\n // TODO (developer) - Handle error\n throw err;\n }\n }\n\nReplace \u003cvar translate=\"no\"\u003eFILE_ID\u003c/var\u003e with the `fileId` of the file for which you\nwant the list of labels."]]