Microsoft Hybrid Messages Create API Not Working

Austin Wang 61 Reputation points
2021-10-15T23:30:19.417+00:00

I'm trying to use MicrosoftGraphAPI to create an email draft, and later send it it. I'm getting stuck making the API call to create the draft. An error is thrown The property 'subject' does not exist on type 'Microsoft.OutlookServices.Message'. Make sure to only use property names that are defined by the type or mark the type as open type. REST APIs for this mailbox are currently in preview. You can find more information about the preview REST APIs at https://dev.outlook.com/.

See below for the full error message.

Note: This is a Microsoft Exchange Hybrid Environment.

Note this part -

Make sure to only use property names that are defined by the type or mark the type as open type.

Seems like there's some sort of configuration that's setting this message property as not open or something. Is there a configuration for that somewhere? I'm not seeing it anywhere.

RESPONSE w/ Error
{
"error": {
"code": "RequestBodyRead",
"message": "The property 'subject' does not exist on type 'Microsoft.OutlookServices.Message'. Make sure to only use property names that are defined by the type or mark the type as open type. REST APIs for this mailbox are currently in preview. You can find more information about the preview REST APIs at https://dev.outlook.com/.",
"innerError": {
"date": "2021-10-14T06:26:10",
"request-id": "5a706591-c6d9-4d3b-8092-af1b696b2655",
"client-request-id": "5a706591-c6d9-4d3b-8092-af1b696b2655"
}
}
}

Request (Exported from postman)
{
"info": {
"_postman_id": "5349b210-3dca-4318-9e5e-a0ef4b06a169",
"name": "Microsoft Graph Client Test",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "https://graph.microsoft.com/v1.0/me/messages",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer eyJ0eXAiO---OMITED",
"type": "text"
},
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n subject: \"Hello world\",\n body: {\n contentType: \"html\",\n content: \"Test email\"\n },\n toRecipients: [ {\n emailAddress: {\n address: \"test@test .co\"\n }\n }],\n ccRecipients: [],\n bccRecipients: []\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://graph.microsoft.com/v1.0/me/messages",
"protocol": "https",
"host": [
"graph",
"microsoft",
"com"
],
"path": [
"v1.0",
"me",
"messages"
]
}
},
"response": []
}
]
}

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,575 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,885 questions
0 comments No comments
{count} votes