Creating Events by Graph API in an Hybrid deployment fails with on-premise mailbox

Frans 1 Reputation point
2021-09-09T11:59:54.863+00:00

I have a Hybrid deployment for Exchange 2016 and Outlook365. I have met the requirements:
https://learn.microsoft.com/en-us/graph/hybrid-rest-support#requirements-for-the-rest-api-to-work-in-hybrid-deployments

My application is able to get an access-token with the correct permissions.
I am using the next procedure: https://learn.microsoft.com/en-us/graph/auth-v2-user

I am able to create an event using the Graph API when the mailbox is online.
I am not able to create an event usering the Graph API when the mailbox is on-premise.

I get the following error:

{
"error": {
"code": "RequestBodyRead",
"message": "The property 'subject' does not exist on type 'Microsoft.OutlookServices.Event'. 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-09-09T10:17:28",
"request-id": "25c0ec28-55d5-439e-9d21-92b8d84f041a",
"client-request-id": "25c0ec28-55d5-439e-9d21-92b8d84f041a"
}
}
}

In this case the property is 'subject', the error message depends on the first field that is present in the request body.

I have tested the event creating by making use of Graph Explorer. This succeeds for the on-premise mailbox.
When using the Graph Explorer access-token in my test, I can succesfully create the event by making use of Postman.
So somewhere there is a difference in the access-token that is the cause of this problem.

My app has all the needes Graph permissions as everything is working correctly for the online mailbox.

I found more articles stating the same problem:

https://learn.microsoft.com/en-us/answers/questions/399564/the-property-39attendees39-does-not-exist-on-type.html
https://stackoverflow.com/questions/68541857/the-property-subject-does-not-exist-on-type-microsoft-outlookservices-event/69073207#69073207
https://blog.thenetw.org/2019/05/13/using-client_credentials-with-microsoft-graph-in-hybrid-exchange-setup/
http://5.9.10.113/67690649/cannot-create-event-on-on-prem-objects-in-hybrid-environment-using-graph-api

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,104 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
522 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Choudhary 601 Reputation points Microsoft Employee
    2021-09-10T19:31:54.807+00:00

    Thank you for reaching out.

    As per the documentation, Only v1.0 of the Mail, Calendar, and Contacts API are available for mailboxes in hybrid deployments. Other v1.0 API sets, such as the Groups API, or APIs in other versions, are not. If you attempt to use an API that is not part of the supported set in a hybrid deployment, you will get the following error message:

    "REST APIs for this mailbox are currently in preview. You can find more information about the preview REST APIs at https://dev.outlook.com." which explains your scenario since you are trying to call users/calender/events.

    Hope this helps.

    Thanks