0
votes

so i got the attachment id from the api, and the payload is data in bytes

from https://developers.google.com/gmail/api/v1/reference/users/messages/attachments#resource

The body data of a MIME message part as a base64url encoded string.........

so i tried decoding it with https://github.com/brianloveswords/base64url and few other base64 plugins - all returing another unreadable string format.

since i wasn't sure if it was an actual file or decoded url i tried exporting contents to a file with known extension without much success, so it should be a download link.

does anyone have any idea how to get a readable format of this string?

payload string sample

1op669AzYx7c9caYxOd0ZWzNE7IqPyUUnmRkib4HPAUbc3FzzEs7xWl6glqXXo2Y_hjSfT9CtS0THzTkf2rZ8UbKU6S

base64 utf8 decoded sample

↑8�k垬☼A��VN��\�>�/i��U�ՁR∟F����A�☺ň<�v¶��C� I-t��]⌂�R☺

string is much muh bigger, testing can be done here for full response https://developers.google.com/gmail/api/v1/reference/users/messages/attachments/get

UPDATE

Solved it https://stackoverflow.com/a/16350999/7579200

1

1 Answers

0
votes

Sounds like you should use the get function.