Method: users.messages.import
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह ईमेल को सिर्फ़ इस उपयोगकर्ता के मेलबॉक्स में इंपोर्ट करता है. साथ ही, एसएमटीपी के ज़रिए ईमेल पाने की तरह ही, ईमेल डिलीवरी को स्कैन करके उसकी कैटगरी तय करता है. इस तरीके से एसपीएफ़ की जांच नहीं की जाती. इसलिए, हो सकता है कि यह कुछ स्पैम मैसेज के लिए काम न करे. जैसे, ऐसे मैसेज जिनमें डोमेन स्पूफ़िंग की कोशिश की गई हो. इस तरीके से कोई मैसेज नहीं भेजा जाता.
एचटीटीपी अनुरोध
- मीडिया अपलोड करने के अनुरोधों के लिए, अपलोड यूआरआई:
POST https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/messages/import
- सिर्फ़ मेटाडेटा के अनुरोधों के लिए मेटाडेटा यूआरआई:
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/import
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
userId |
string
उपयोगकर्ता का ईमेल पता. पुष्टि किए गए उपयोगकर्ता की जानकारी देने के लिए, खास वैल्यू me का इस्तेमाल किया जा सकता है.
|
क्वेरी पैरामीटर
पैरामीटर |
internalDateSource |
enum (InternalDateSource )
Gmail में मैसेज की इंटरनल तारीख का सोर्स.
|
neverMarkSpam |
boolean
Gmail की स्पैम क्लासिफ़ायर सुविधा के फ़ैसले को अनदेखा करें और इस ईमेल को मेलबॉक्स में कभी भी स्पैम के तौर पर मार्क न करें.
|
processForCalendar |
boolean
ईमेल में मौजूद कैलेंडर के न्योतों को प्रोसेस करें और इस उपयोगकर्ता के लिए, निकाली गई मीटिंग को Google Calendar में जोड़ें.
|
deleted |
boolean
ईमेल को 'स्थायी रूप से मिटाया गया' के तौर पर मार्क करें, न कि 'ट्रैश' के तौर पर. साथ ही, यह भी सेट करें कि ईमेल सिर्फ़ Vault के एडमिन को Google Vault में दिखे. इसका इस्तेमाल सिर्फ़ Google Workspace खातों के लिए किया जाता है.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में Message
का उदाहरण है.
जवाब का मुख्य भाग
कामयाब रहने पर, जवाब के मुख्य हिस्से में Message
का एक इंस्टेंस शामिल किया जाता है.
अनुमति के दायरे
इसके लिए, OAuth के इनमें से किसी एक स्कोप की ज़रूरत होती है:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.insert
ज़्यादा जानकारी के लिए, अनुमति से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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.import\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\nImports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message.\n\n### HTTP request\n\n- Upload URI, for media upload requests: \n `POST https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/messages/import`\n- Metadata URI, for metadata-only requests: \n `POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/import`\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### Query parameters\n\n| Parameters ||\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `internalDateSource` | `enum (`[InternalDateSource](/workspace/gmail/api/reference/rest/v1/InternalDateSource)`)` Source for Gmail's internal date of the message. |\n| `neverMarkSpam` | `boolean` Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. |\n| `processForCalendar` | `boolean` Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. |\n| `deleted` | `boolean` Mark the email as permanently deleted (not TRASH) and only visible in [Google Vault](http://support.google.com/vault/) to a Vault administrator. Only used for Google Workspace accounts. |\n\n### Request body\n\nThe request body contains an instance of [Message](/workspace/gmail/api/reference/rest/v1/users.messages#Message).\n\n### Response body\n\nIf successful, the response body contains an instance of [Message](/workspace/gmail/api/reference/rest/v1/users.messages#Message).\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- `\n https://www.googleapis.com/auth/gmail.insert`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]