retrieving attachments from a messageview

518 views
Skip to first unread message

lambi 674

unread,
Jun 14, 2017, 10:20:17 AM6/14/17
to InboxSDK
Hello there,
I'm working on a chrome extension which is supposed to extract both body text and attachments and send them to a backend.
From what I read, attachments shortlived url API (getDownloadURL)  has been deprecated apparently since inbox.google.com will not provide any result.
I don't understand the decision  since it works with the gmail web page and would be still useful in this particular environment

Please confirm my understanding. I have started exploring the dom of the messageView body as a workaround....

rgds, Jean-Michel

Chris Cowan

unread,
Jun 15, 2017, 3:00:16 PM6/15/17
to InboxSDK
The getDownloadURL method was moved from AttachmentCardView onto the AttachmentCardClickEvent, so the only way to use it is when the user clicks on a button added to the attachment card. Here's an example of its use:

sdk.Conversations.registerFileAttachmentCardViewHandler(card => {
card.addButton({
iconUrl: chrome.runtime.getURL('zipicon.png'),
tooltip: 'Foo123',
onClick(event) {
event.getDownloadURL().then(url => {
console.log('download url', url);
});
}
});
})



The InboxSDK no longer provides a supported way to get the download url of an attachment card before the user clicks on it due to technical limitations with Inbox. If that's important to you, then you may want to use the Gmail API

Abhishek Jain

unread,
Oct 5, 2022, 12:37:16 PM10/5/22
to InboxSDK
Did anyone figure out any other way to download the attachment without asking the user to do extra work? 
Our use case is
We have a Chrome extension https://chrome.google.com/webstore/detail/fyle-expense-management/abggpefphmldapcoknbcaadbpdjjmjgk which is used to submit business expenses
We read the content of the email and the attachments when the user clicks on the Add Expense CTA.
This would no longer be possible after the InboxSDK and Manifest upgrade, this is quite critical to our business, any help is appreciated

Reply all
Reply to author
Forward
0 new messages