In JavaScript file I'm using REST to communicate with Office 365 APIs for mail, I'm getting the messages but nothing about the message's ContentBytes, since I need to save the message (email) in file with eml extension.
The code is:
var messageEndpoint = "https://outlook.office.com/api/v2.0/me/messages/" + mailId + "/attachments";
$.ajax({
type: "GET",
url: messageEndpoint,
headers: {
'Authorization': 'Bearer ' + outlookToken,
},
success: function (messageResponse) { }
"messageResponse" has the message properties( like: from, to, body, etc.) but not the Content Bytes.
Anybody has idea how to convert the Office 365 mail messages REST response to byte [] then to save it in file ?
Thanks