Answer by standup75 for Gmail API - Parse message content (Base64 decoding?)...
You need to search where the body for a given mime type is, I have written a recursive function for that:function searchBodyRec(payload, mimeType){ if (payload.body && payload.body.size...
View ArticleAnswer by FullStack for Gmail API - Parse message content (Base64 decoding?)...
Regarding the Base64 decoding, you can use atob(dataToDecode)For Gmail, you'll also want to replace some characters:atob( dataToDecode.replace(/-/g, '+').replace(/_/g, '/') ); The above function is...
View ArticleAnswer by artis3n for Gmail API - Parse message content (Base64 decoding?)...
Ah! I figured it out. parts is an array, so I should have been calling it like: gapi.client.gmail.users.messages.get({'id': <message ID>}).payload.parts[0].body.dataNow my problem is decoding the...
View ArticleAnswer by Eric D for Gmail API - Parse message content (Base64 decoding?)...
Depending on what your emails look like (single text/plain part? multipart with text/html? attachments, etc?) you may or may not have any "parts" in your email.payload and instead you'll have what...
View ArticleGmail API - Parse message content (Base64 decoding?) with Javascript
I'm trying to use the Gmail API to get a user's email, grab the message subject and body, and then display it on a webpage. I'll be doing other stuff with it, but this is the part that I am having...
View Article
More Pages to Explore .....