Method: users.messages.attachments.get
Restituisce l'allegato del messaggio specificato.
Richiesta HTTP
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}
L'URL utilizza la sintassi di transcodifica gRPC.
Parametri del percorso
Parametri |
userId |
string
L'indirizzo email dell'utente. È possibile utilizzare il valore speciale me per indicare l'utente autenticato.
|
messageId |
string
L'ID del messaggio che contiene l'allegato.
|
id |
string
L'ID dell'allegato.
|
Corpo della richiesta
Il corpo della richiesta deve essere vuoto.
Corpo della risposta
In caso di esito positivo, il corpo della risposta contiene un'istanza di MessagePartBody
.
Ambiti di autorizzazione
Richiede uno dei seguenti ambiti OAuth:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.readonly
Per ulteriori informazioni, consulta la Guida alle autorizzazioni.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-09-05 UTC.
[null,null,["Ultimo aggiornamento 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"]]