Method: users.drafts.update
Zastępuje treść wersji roboczej.
Żądanie HTTP
- Identyfikator URI przesyłania dla żądań przesłania multimediów:
PUT https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/drafts/{id}
- Identyfikator URI metadanych dla żądań tylko metadanych:
PUT https://gmail.googleapis.com/gmail/v1/users/{userId}/drafts/{id}
Adres URL używa składni transkodowania gRPC.
Parametry ścieżki
Parametry |
userId |
string
Adres e-mail użytkownika. Specjalna wartość me może służyć do wskazania uwierzytelnionego użytkownika.
|
id |
string
Identyfikator wersji roboczej do zaktualizowania.
|
Treść żądania
Treść żądania zawiera wystąpienie elementu Draft
.
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu Draft
.
Zakresy autoryzacji
Wymaga jednego z tych zakresów OAuth:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.compose
Więcej informacji znajdziesz w przewodniku po autoryzacji.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-05 UTC.
[null,null,["Ostatnia aktualizacja: 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"]]