Method: users.messages.attachments.get
Ruft den angegebenen Nachrichtenanhang ab.
HTTP-Anfrage
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{messageId}/attachments/{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.
|
messageId |
string
ID der Nachricht, die den Anhang enthält
|
id |
string
Die ID des Anhangs.
|
Anfragetext
Der Anfragetext muss leer sein.
Antworttext
Wenn der Vorgang erfolgreich abgeschlossen wurde, enthält der Antworttext eine Instanz von MessagePartBody
.
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
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 attachment using the message and attachment IDs."],["Requires user authentication and authorization with specific Gmail scopes."],["Uses a simple GET request with path parameters for user, message, and attachment IDs."],["Returns the attachment data as a `MessagePartBody` object in the response."],["Request body should be empty for this operation."]]],["This document details how to retrieve a specific message attachment using a GET request. The core action involves sending a request to the provided URL, `https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}`, with the request body being empty. The URL requires three path parameters: `userId`, `messageId`, and `id`. A successful request will return a `MessagePartBody` instance, and access requires one of the listed OAuth scopes. The document also includes a \"Try it!\" feature.\n"]]