We had integrated our application with Microsoft Graph API enabling user to access their outlook through our application. The integration works fine with office365 users but having intermittent issues with users in on-premise server.
Initially after enabling HMA in on-premise server the integration started working, but for past two weeks we are facing issue with the integration and receiving error message as below.
HTTP error: 404
Error code: MailboxNotEnabledForRESTAPI or MailboxNotSupportedForRESTAPI
Error message: "REST API is not yet supported for this mailbox."
But we had not made any recent changes to server or Graph API access. Surprisingly, it started to working today as this was sporadic we need assistance in understanding the issue. Any help is greatly appreciated.
Update:
Adding the work flow information of how we have configured Graph API into our web application to get better help.
We have a web application, where user can access his outlook resources by authenticating himself via OAUTH.
Below are the steps followed in our application.
The above steps works without any issue for O365 users and also it worked for on-premise users as well recently we are getting two errors at different times.
{
"error": {
"code": "ResourceNotFound",
"message": "Resource could not be discovered.",
"innerError": {
"date": "2020-10-30T08:03:20",
"request-id": "c1f461d7-0757-4a54-a727-58cb0da7fe5d",
"client-request-id": "c1f461d7-0757-4a54-a727-58cb0da7fe5d"
}
}
}
HTTP error: 404
Error code: MailboxNotEnabledForRESTAPI or MailboxNotSupportedForRESTAPI
Error message: "REST API is not yet supported for this mailbox."
We have noted the below cases.
- We have isolated the scenario and used MS Graph explorer with user credentials, able to get through the process. (pass)
- We tried Using the access token created with MS Graph explorer, in our web application and we were able to send email without any issues. (pass)
- The issue is raising when we are trying to hit the Graph API for on premise user ,using access token created using our web application. (Fail)
MS Grpah Explorer:
The connection is established using https://developer.microsoft.com/en-us/graph/graph-explorer (Probably SPA)
Web Application:
The connection is established using "Authorization" Grant
Q1)
We are not sure if the issue is arsing due to the "Authorization" Grant ?
Q2)
Is O365 hybrid environment is mandatory or mailbox in on premise is enough ?