Method: users.drafts.create
DRAFT
लेबल के साथ एक नया ड्राफ़्ट बनाता है.
एचटीटीपी अनुरोध
- मीडिया अपलोड करने के अनुरोधों के लिए, यूआरआई अपलोड करें:
POST https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/drafts
- सिर्फ़ मेटाडेटा से जुड़े अनुरोधों के लिए, मेटाडेटा यूआरआई:
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/drafts
यूआरएल, gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल करता है.
पाथ के पैरामीटर
पैरामीटर |
userId |
string
उपयोगकर्ता का ईमेल पता. खास वैल्यू me का इस्तेमाल, पुष्टि किए गए उपयोगकर्ता की जानकारी देने के लिए किया जा सकता है.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में Draft
का उदाहरण है.
जवाब का मुख्य भाग
कामयाब रहने पर, जवाब के मुख्य हिस्से में Draft
का एक इंस्टेंस शामिल किया जाता है.
अनुमति देने के दायरे
इनमें से कोई एक OAuth स्कोप ज़रूरी है:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.compose
ज़्यादा जानकारी के लिए, अनुमति देने से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-09-05 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-09-05 (UTC) को अपडेट किया गया."],[[["Creates a new draft with the `DRAFT` label, allowing for both media upload and metadata-only requests."],["Requires providing the user's email address (`userId`) as a path parameter, with `me` indicating the authenticated user."],["The request and response bodies utilize the `Draft` object for data exchange."],["Needs authorization with specific OAuth scopes, including `https://mail.google.com/`, `https://www.googleapis.com/auth/gmail.modify`, or `https://www.googleapis.com/auth/gmail.compose`."]]],["This content outlines how to create a new draft in Gmail's API. It involves sending a `POST` request to either a media upload URI (`/upload/`) or a metadata URI (`/`). The `userId` path parameter, representing the user's email, is required; `me` represents the authenticated user. The request and response bodies both utilize the `Draft` instance. Authorization requires specific OAuth scopes: `mail.google.com/`, `gmail.modify`, or `gmail.compose`.\n"]]