问题
We have a hybrid Exchange deployment. Trying to create a subscription to get updates, creates, deletes on Calendar and Contacts.
In Graph Explorer I'm logged in as an Office 365 user that has full access to the On-Premise mailbox I'm trying to access (user@domain.com
). I'm entering:
POST | v1.0 | https://graph.microsoft.com/v1.0/subscriptions
Request Body:
{
"changeType": "updated",
"notificationUrl": "https://our.URL/WebHooks/Graph/GraphMessagesHook.php",
"resource": "users/user@domain.com/contacts",
"expirationDateTime": "2018-10-23T04:00:00Z",
"clientState": "secret"
}
Response is:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: NotFound; Reason: Not Found]",
"innerError": {
"request-id": "981c0892-e6d8-490b-838d-880d8268037f",
"date": "2018-10-20T20:32:07"
}
}
}
As a test, I created another user in Office 365 and did the same request body:
{
"changeType": "updated",
"notificationUrl": "https://our.URL/WebHooks/Graph/GraphMessagesHook.php",
"resource": "users/userOn365@domain.com/contacts",
"expirationDateTime": "2018-10-23T04:00:00Z",
"clientState": "secret"
}
This time instead of a 404 NotFound
, I got a 403
:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Forbidden]",
"innerError": {
"request-id": "1f378cf0-b1ec-4b87-ba03-8dee120b748b",
"date": "2018-10-21T20:42:46"
}
}
}
What am I missing?
回答1:
The Microsoft Graph API for on premise mailboxes is only a subset of the cloud functionality.
Don’t think they implemented subscriptions for on-premise mailboxes. That would be pretty resource intensive on both sides.
To my knowledge they just proxy the request to your local Exchange (which is configured to accept the Azure tokens). For rest calls that is easy, for subscriptions the routing would be difficult.
来源:https://stackoverflow.com/questions/52910327/status-code-notfound-reason-not-found-when-creating-subscription-to-on-prem