Method: users.messages.get
Ruft die angegebene Nachricht ab.
HTTP-Anfrage
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{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 der abzurufenden Nachricht. Diese ID wird normalerweise mit messages.list abgerufen. Die ID ist auch im Ergebnis enthalten, wenn eine Nachricht eingefügt (messages.insert ) oder importiert (messages.import ) wird.
|
Abfrageparameter
Parameter |
format |
enum (Format )
Das Format, in dem die Nachricht zurückgegeben werden soll.
|
metadataHeaders[] |
string
Wenn angegeben und das Format METADATA ist, dürfen nur Header angegeben werden.
|
Anfragetext
Der Anfragetext muss leer sein.
Antworttext
Wenn der Vorgang erfolgreich abgeschlossen wurde, enthält der Antworttext eine Instanz von Message
.
Autorisierungsbereiche
Erfordert einen der folgenden OAuth-Bereiche:
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
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)."],[[["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"]]