Method: users.drafts.create
تنشئ مسودة جديدة تحمل التصنيف DRAFT
.
طلب HTTP
- معرّف الموارد المنتظم (URI) للتحميل، لطلبات تحميل الوسائط:
POST https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/drafts
- معرّف الموارد المنتظم (URI) للبيانات الوصفية، لطلبات البيانات الوصفية فقط:
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/drafts
يستخدِم عنوان URL بنية تحويل ترميز 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 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-09-05 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-09-05 (حسب التوقيت العالمي المتفَّق عليه)"],[[["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"]]