I am using Microsoft graph SDK for sending mail using office 365 account from my iOS application recently I am able to send mail body but I am not able to send attachments with it, I am referring This link for the attachment but could not able to send attachments.
I have tried to hit https://graph.microsoft.com/v1.0/me/sendMail URL using following JSON
{ "message":{ "subject":"Meet for lunch?", "hasAttachments":true, "body":{ "contentType":"Text", "content":"The new cafeteria is open." }, "toRecipients":[ { "emailAddress":{ "address":"[email protected]" } } ], "attachments":[ { "@odata.type":"#Microsoft.OutlookServices.FileAttachment", "name":"menu.png", "Content-Type":"multipart/mixed" "contentBytes":"base64 string" } ] }, "saveToSentItems":"false" }
with header of
"content-type":"application/x-www-form-urlencoded"
"Authorization" : "bearer"
but I am getting status code 415 with unsupported media type.