I'm trying to download an attachment using Gmail's API(JavaScript),
So far I was able to get the messages including all of their properties. From a search I did, I understand that I need to access to: message-->payload-->parts[] and then to get some data, such as body.data, MIMEtype and some more. However, I don't understand the concept of the parts, it seems like every massage has a part, which is an array of 2 objects with the same properties, and I don't really know what data I need to retrieve.
Let assume I got the required data from the message object, from my understanding, I should get an encrypted string which then needs to be converted to Base64 string, what's next? How do I download\read the attachment?
Thanks in advance.