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