Explore Plans
Mobile menu Close menu
Gmail

Get attachment by filename

Pro plus icon This query returns an attachment from a specific Gmail message, located by its filename, as links to a temporary copy of the file that IFTTT hosts and removes automatically, along with the attachment's details.

Developer info

API endpoint slug
gmail.get_attachment_by_filename
Runtime method
performQuery("gmail.get_attachment_by_filename"}

Query fields

Message Text input > Other

Label
Message ID
Helper text
The message that contains the attachment. Use the MessageId ingredient from a Gmail trigger or query.
Slug
message_id
Required
true
Can have default value
true

Attachment filename Text input > Other

Label
Attachment filename
Helper text
The file name of the attachment to get, for example report.pdf. Capitalization doesn't matter. IFTTT saves a temporary copy of the matched file so your Applet can use a link to it.
Slug
attachment_filename
Required
true
Can have default value
true

Attachment size Text input > Other

Label
Attachment size
Helper text
Optional: the attachment's size in bytes, to pick one attachment when several share a filename. The attachment you pick here is the one IFTTT copies and links.
Slug
attachment_size
Required
false
Can have default value
true

Ingredients

Temporary public attachment url Link to a temporary copy of the attachment, hosted by IFTTT rather than Gmail. Anyone with the link can open the file until the copy is removed after about a day, so use it in this Applet rather than saving it. Filled only on the result IFTTT copied.

Slug
temporary_public_attachment_url
Filter code
Gmail.getAttachmentByFilename.TemporaryPublicAttachmentUrl
Type
File URL
Example
https://locker.ifttt.com/v3/temp/12345/ab/cd34ef56a1b2/report.pdf?sharing_key=9f2c4e6a8b1d3f5079e2c4a6b8d0f1a3

Temporary private attachment url Link to the same temporary IFTTT-hosted copy that only you can open, and only while signed in to IFTTT. The copy is removed automatically about a day later. Filled on the same result as the public link; empty on the others.

Slug
temporary_private_attachment_url
Filter code
Gmail.getAttachmentByFilename.TemporaryPrivateAttachmentUrl
Type
Web URL
Example
https://locker.ifttt.com/v3/temp/12345/ab/cd34ef56a1b2/report.pdf

Attachment filename The matched attachment's file name.

Slug
attachment_filename
Filter code
Gmail.getAttachmentByFilename.AttachmentFilename
Type
String
Example
report.pdf

Attachment type The matched attachment's MIME type.

Slug
attachment_type
Filter code
Gmail.getAttachmentByFilename.AttachmentType
Type
String
Example
application/pdf

Attachment size The matched attachment's size in bytes.

Slug
attachment_size
Filter code
Gmail.getAttachmentByFilename.AttachmentSize
Type
String
Example
52133

Message Gmail's id for the message.

Slug
message_id
Filter code
Gmail.getAttachmentByFilename.MessageId
Type
String
Example
19ff0b2ef9fbb3d6

Thread Gmail's id for the conversation the message belongs to.

Slug
thread_id
Filter code
Gmail.getAttachmentByFilename.ThreadId
Type
String
Example
19ff0b2ef9fbb3d6

Subject The email's subject.

Slug
subject
Filter code
Gmail.getAttachmentByFilename.Subject
Type
String
Example
Project update

From The sender's email address.

Slug
from_address
Filter code
Gmail.getAttachmentByFilename.From
Type
String
Example
jane@example.com

Received at Date and time the email arrived.

Slug
received_at
Filter code
Gmail.getAttachmentByFilename.ReceivedAt
Type
Date with time (ISO8601)
Example
2020-07-08T04:17:06+05:00

Message url Link that opens the email in Gmail.

Slug
message_url
Filter code
Gmail.getAttachmentByFilename.MessageUrl
Type
Web URL
Example
https://mail.google.com/mail/#all/18c1a2b3d4e5f607