I was getting the same error with /me/messages
. This is how my request looked like with python:
body = {
"message": {
"subject": "test subject",
"body": {
"contentType": "HTML",
"content": "test content"
},
"toRecipients": [{
"emailAddress": {
"address": "******@somewhere.com"
}}]
}
}
response = requests.post(create_mail_url, data=json.dumps(body), headers=headers)
Strangly this works fine with /me/sendMail
but when calling /me/messages
it was necessary to remove the outer object with body["message"]
. This mans that in case of a json message the body is different. Your link points to send-message, I think you should take a look at this page https://learn.microsoft.com/en-us/graph/api/user-post-messages?view=graph-rest-1.0&tabs=http that discribes the format for create-message. There might be similar differences for mime.