Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outlook Mail REST API: send message with attachment

I'm trying to use next API method: https://msdn.microsoft.com/office/office365/APi/mail-rest-operations#SendMessages. Sending messages without attachments works just fine, but I can not understand how to send message with attachments.

According to docs, Message structure can contain array of Attachments with items of type https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#RESTAPIResourcesFileAttachment . Problem is in the field ContentBytes -- it is impossible to dump bytes to JSON before sending request to this API method (actually dumping any BLOB to JSON is nonsense).

How should I pass Attachments using REST API at all?

Thanks.

like image 631
Anton Koval' Avatar asked Aug 25 '15 07:08

Anton Koval'


1 Answers

There's an example of passing the attachment on that page: https://msdn.microsoft.com/office/office365/APi/mail-rest-operations#SendMessageOnTheFly

like image 78
Jason Johnston Avatar answered Sep 20 '22 02:09

Jason Johnston