Learn R Programming

gmailr (version 0.5.0)

attachment: Retrieve an attachment to a message

Description

Function to retrieve an attachment to a message by id of the attachment and message. To save the attachment use save_attachment.

Usage

attachment(id, message_id, user_id = "me")

Arguments

id
id of the attachment
message_id
id of the parent message
user_id
gmail user_id to access, special value of 'me' indicates the authenticated user.

References

https://developers.google.com/gmail/api/v1/reference/users/messages/attachments/get

Examples

Run this code
my_attachment = attachment('a32e324b', '12345')
save attachment to a file
save_attachment(my_attachment, 'photo.jpg')

Run the code above in your browser using DataLab