Method: users.drafts.update
Damit wird der Inhalt eines Entwurfs ersetzt.
HTTP-Anfrage
- Upload-URI für Medien-Uploadanfragen:
PUT https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/drafts/{id}
- Metadaten-URI, für Anfragen, die nur Metadaten enthalten:
PUT https://gmail.googleapis.com/gmail/v1/users/{userId}/drafts/{id}
Die URL verwendet die Syntax der gRPC-Transcodierung.
Pfadparameter
Parameter |
userId |
string
Die E-Mail-Adresse des Nutzers. Mit dem speziellen Wert me kann der authentifizierte Nutzer angegeben werden.
|
id |
string
Die ID des Entwurfs, der aktualisiert werden soll.
|
Anfragetext
Der Anfragetext enthält eine Instanz von Draft
.
Antworttext
Wenn der Vorgang erfolgreich abgeschlossen wurde, enthält der Antworttext eine Instanz von Draft
.
Autorisierungsbereiche
Erfordert einen der folgenden OAuth-Bereiche:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.compose
Weitere Informationen finden Sie im Leitfaden zur Autorisierung.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2024-09-05 (UTC).
[null,null,["Zuletzt aktualisiert: 2024-09-05 (UTC)."],[[["This method replaces the content of an existing draft using either a media upload URI for attachments or a metadata URI for metadata-only updates."],["It requires specifying the user ID (`userId`) and the draft ID (`id`) as path parameters in the request URL."],["The request body must contain a `Draft` object representing the new draft content."],["Upon successful execution, the API returns the updated `Draft` object in the response body."],["Authorization is necessary and requires one of the specified OAuth scopes related to Gmail access and modification."]]],["This document details updating a draft in Gmail using a PUT request. Two URIs are specified: one for media uploads and another for metadata. The `userId` and `id` path parameters identify the user and draft, respectively. The request body requires a `Draft` instance, and a successful response also returns a `Draft` instance. Authorization requires one of three specified OAuth scopes, such as `gmail.modify`, `gmail.compose` or `mail.google.com/`.\n"]]