Method: users.messages.get
Pobiera określony komunikat.
Żądanie HTTP
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{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 wiadomości do pobrania. Ten identyfikator jest zwykle pobierany za pomocą messages.list . Identyfikator jest też zawarty w wyniku po wstawieniu wiadomości (messages.insert ) lub zaimportowaniu wiadomości (messages.import ).
|
Parametry zapytania
Parametry |
format |
enum (Format )
Format, w jakim ma zostać zwrócona wiadomość.
|
metadataHeaders[] |
string
Jeśli jest podana i ma format METADATA , uwzględnij tylko nagłówki.
|
Treść żądania
Treść żądania musi być pusta.
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu Message
.
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.readonly
https://www.googleapis.com/auth/gmail.metadata
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."],[[["Retrieves a specific email message using the message ID and user ID."],["Allows specifying the message format (e.g., full, metadata) and specific metadata headers to include."],["Requires authorization with specific Gmail scopes, such as read-only, modify, or metadata access."],["Returns the complete message data or metadata, depending on the requested format, in the response."],["Utilizes an HTTP GET request with path and query parameters to specify the request details."]]],["This content outlines how to retrieve a specific message from a user's Gmail account. It uses a `GET` request to a URL with the user's ID and message ID as path parameters. Optional query parameters (`format`, `metadataHeaders`) refine the response. The request body must be empty, and a successful response returns a Message object. Authorization requires specific OAuth scopes, including options for read-only, modification, or metadata access.\n"]]