I have a connection to my organization’s mailbox. Using the MS Graph API, the response from the API returns the given message’s attachment (which originally is a .xlsx file) as content bytes. I use the following documentation: Get attachment - Microsoft Graph v1.0 | Microsoft Learn
Depending on the API call that I use, this either looks something like this:
UEsDBAoAAAAAAHZXRlMb8/ygFgAAABYAAAGVzdC50eHR0aGlzIGlzIHNvbWUgdGVzdCB0ZXh0UEsBAj8ACgAAAAAAdldGUxvz/KAWAAAAFgAAAAgAJAAAAAAAAAAgAAAAAAAAAHRlc3QudHh0CgAgAAAAAAABABgAv57iEEW61wG/nuIQRbrXAcZ34hBFutcBUEsFBgAAAAABAAEAWgAAADwAAAAAAA==
Or like this:

I tried decoding it as base64, but I get an error that it contains non-base 64 characters, more than two padding characters or an illegal character among the padding characters. I would like to turn the result into a .xlsx file.
