Method: users.messages.batchModify
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
चुने गए मैसेज के लेबल में बदलाव करता है.
एचटीटीपी अनुरोध
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchModify
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
userId |
string
उपयोगकर्ता का ईमेल पता. पुष्टि किए गए उपयोगकर्ता की जानकारी देने के लिए, खास वैल्यू me का इस्तेमाल किया जा सकता है.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में नीचे दिए गए स्ट्रक्चर वाला डेटा होता है:
JSON के काेड में दिखाना |
{
"ids": [
string
],
"addLabelIds": [
string
],
"removeLabelIds": [
string
]
} |
फ़ील्ड |
ids[] |
string
उन मैसेज के आईडी जिनमें बदलाव करना है. हर अनुरोध में 1,000 आईडी शामिल किए जा सकते हैं.
|
addLabelIds[] |
string
मैसेज में जोड़ने के लिए लेबल आईडी की सूची.
|
removeLabelIds[] |
string
मैसेज से हटाने के लिए, लेबल आईडी की सूची.
|
जवाब का मुख्य भाग
अगर एपीआई सही से जुड़ जाता है, तो जवाब का मुख्य हिस्सा खाली होता है.
अनुमति के दायरे
इसके लिए, OAuth के इनमें से किसी एक स्कोप की ज़रूरत होती है:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
ज़्यादा जानकारी के लिए, अनुमति से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],[],null,["# Method: users.messages.batchModify\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nModifies the labels on the specified messages.\n\n### HTTP request\n\n`POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/batchModify`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------|\n| `userId` | `string` The user's email address. The special value `me` can be used to indicate the authenticated user. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------|\n| ``` { \"ids\": [ string ], \"addLabelIds\": [ string ], \"removeLabelIds\": [ string ] } ``` |\n\n| Fields ||\n|--------------------|---------------------------------------------------------------------------------------|\n| `ids[]` | `string` The IDs of the messages to modify. There is a limit of 1000 ids per request. |\n| `addLabelIds[]` | `string` A list of label IDs to add to messages. |\n| `removeLabelIds[]` | `string` A list of label IDs to remove from messages. |\n\n### Response body\n\nIf successful, the response body is empty.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://mail.google.com/`\n- `\n https://www.googleapis.com/auth/gmail.modify`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]