Following response is received when creating a microsoft graph subscription .
what does this applicationId means. is it static value ?.
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#subscriptions/$entity",
"id": "7f105c7d-2dc5-4530-97cd-4e7ae6534c07",
"resource": "me/mailFolders('Inbox')/messages",
"applicationId": "24d3b144-21ae-4080-943f-7067b395b913",
"changeType": "created,updated",
"clientState": "secretClientValue",
"notificationUrl": "https://webhook.azurewebsites.net/api/send/myNotifyClient",
"expirationDateTime": "2016-11-20T18:23:45.9356913Z",
"creatorId": "8ee44408-0679-472c-bc2a-692812af3437"
}
as it imply, it is client id where you register app.When you list the all subscriptions , api only returns subscriptions that are created by specific client (application).
i have confused subscription application id's which were created using graph explore and my app
Related
I'm looking through the Microsoft documentation on Subscription objects (https://learn.microsoft.com/en-us/graph/webhooks). I want to receive a notification for when a user changes their Profile Picture (photo property)
I sent the following subscription request, and I am successful in receiving notification when I update user properties, but not when I change their picture:
POST /v1.0/subscriptions HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
Authorization: Bearer <TOKEN>
{
"changeType": "updated",
"notificationUrl": "https://00000.ngrok.io/listen",
"resource": "/users",
"expirationDateTime": "2020-12-09T11:00:00.0000000Z",
"clientState": "SecretClientState"
}
Response:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions/$entity",
"id": "00000000-0000-0000-0000-000000000000",
"resource": "/users",
"applicationId": "00000000-0000-0000-0000-000000000000",
"changeType": "updated",
"clientState": "SecretClientState",
"notificationUrl": "https://00000.ngrok.io/listen",
"lifecycleNotificationUrl": null,
"expirationDateTime": "2020-12-09T11:00:00Z",
"creatorId": "00000000-0000-0000-0000-000000000000",
"includeResourceData": null,
"latestSupportedTlsVersion": "v1_2",
"encryptionCertificate": null,
"encryptionCertificateId": null
}
Is there a way to subscript to photo changes in the Microsoft Graph in aggregate? Or do I have to subscribe to each user individually?
Reading and updating a user's profile photo is only possible if the user has a mailbox. Additionally, any photos that may have been previously stored using the thumbnailPhoto property (using the Azure AD Graph or through AD Connect synchronization) are no longer accessible through the Microsoft Graph photo property of the user resource. Microsoft documentation Microsoft Graph API limitation talks about it, refer "photo restrictions" section.
I've created some Subscriptions for certain inboxes many months ago, and system successfully received notifications about received emails, also subscriptions are regularly updated to increase expiration dates.
Here's the list of my subscriptions:
https://graph.microsoft.com/v1.0/subscriptions/
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "ef4d00ca-cf0c-4da6-bded-1ab47295e3f5",
"resource": "users/622eee14-9413-49e3-ac53-10148eba09be/messages",
"applicationId": "281e7aa8-7ef8-4a02-9195-83ffb149d95c",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://...",
"expirationDateTime": "2019-12-03T23:00:03.0238504Z",
"creatorId": "2ca67f35-32ba-4ef5-99ab-6686a93e0007"
},
{
"id": "6f056383-df34-47b5-aaf2-dce3fca1c511",
"resource": "users/3ccbd0c8-f11e-4bac-99df-27b78be74aaa/messages",
"applicationId": "281e7aa8-7ef8-4a02-9195-83ffb149d95c",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://...",
"expirationDateTime": "2019-12-03T23:00:01.4332477Z",
"creatorId": "2ca67f35-32ba-4ef5-99ab-6686a93e0007"
}
]
}
But starting today (2019-12-02) system stopped receiving notifications.
Then I've created subscription with my test account
subscription was created successfully,
calling https://graph.microsoft.com/v1.0/subscriptions/, I've received response
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "dfefbb04-887f-439f-bb09-a6075eeca8cd",
"resource": "users/ebaeb8ab-44c1-40e1-8725-635759c035db/messages",
"applicationId": "57afcb67-6089-4abc-bba8-2470ce9c22ec",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://63efa1ea.ngrok.io/api/Core/MailNotification/Listen",
"expirationDateTime": "2019-12-04T13:10:14.2380272Z",
"creatorId": "6a046ec1-ec01-43de-83b8-0e0696e89ecf"
}
]
}
I've tried sending email to mailbox, mentioned above, but still I receive no notifications.
Does something changed to Ms Graph? Is there a way to troubleshoot this problem, can I see some logs in azure portal or somewhere else, did MS Graph tried to send me a notification? Or it just suddenly stopped working?
It seems there was a degradation of service that affected Microsoft Graph Exchange services from 30th November '19. This seems to have been resolved as indicated from this comment.
This seems to be related to a current problem with Graph Subscriptions that I have as well. There is a Github Issue of this, with several reports of this problem.
If i have Calendars.Read application permission for events in user calenders, how do i create a subscription to a user calendar using graph api.
below i tried to create event subscription for 'user#mydomain.com' mailbox by updating resource parameter to 'users/user#mydomain.com/events' and is this the right way to subscribe get notifications of shared,delegated calendars of user?
{
"changeType": "created,updated",
"resource": "users/user#mydomain.com/events",
"notificationUrl": "https://webhook.azurewebsites.net/api/send/myNotifyClient",
"expirationDateTime":"2016-11-20T18:23:45.9356913Z",
"clientState": "secretClientValue"
}
(Clarification: I have never created a notification for a resource of this type).
You did not state what the error was.
In your resource field it might need to be:
/users/{userId}/events
The {userId} should not be a UPN but the UUID of the user.
{
"changeType": "created,updated",
"resource": "users/{userId}/events",
"notificationUrl": "https://webhook.azurewebsites.net/api/send/myNotifyClient",
"expirationDateTime":"2016-11-20T18:23:45.9356913Z",
"clientState": "secretClientValue"
}
We are using a multitenant application.
We created a subscription to listen to calendar events for a particular user, but we are not receiving the notifications.
The user accepted the following scopes: Calendars.Read Calendars.ReadWrite Calendars.Read.Shared Calendars.ReadWrite.Shared offline_access User.Read.All
When we call to POST https://graph.microsoft.com/v1.0/subscriptions
BODY:
{
"resource": "/users/31c61efc-bc28-4552-9f0d-1a8735767c4e/calendars/AAMkAGRjZjY3OGRmLWU3MjAtNGExYy1hOTk0LTNkNjExOWVhZmYyNQBGAAAAAAD3yBF0B84VRJLe9CCZ4-ajBwDf5J1F10FqQ6VkC14neUWZAAAAAAEGAADf5J1F10FqQ6VkC14neUWZAABEL_2XAAA\u003d/events",
"changeType": "created,updated,deleted",
"clientState": "XXXXXX",
"notificationUrl": "https://XXXXX.ngrok.io/notification/event",
"expirationDateTime": "2019-05-31T14:42:08.651Z"
}
Then the notificationUrl is called and we receive the validation token:
Validation: Testing client application reachability for subscription Request-Id: 9d020355-7589-4485-ba29-62d1ec899723
But when we login into the 31c61efc-bc28-4552-9f0d-1a8735767c4e account and update or create an event, no notification is beign sent.
If we call to GET https://graph.microsoft.com/v1.0/subscriptions the subscription is created:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "b92d909e-b1b5-49b8-af54-74b7956d6565",
"resource": "/users/31c61efc-bc28-4552-9f0d-1a8735767c4e/calendars/AAMkAGRjZjY3OGRmLWU3MjAtNGExYy1hOTk0LTNkNjExOWVhZmYyNQBGAAAAAAD3yBF0B84VRJLe9CCZ4-ajBwDf5J1F10FqQ6VkC14neUWZAAAAAAEGAADf5J1F10FqQ6VkC14neUWZAABEL_2XAAA=/events",
"applicationId": "XXXX",
"changeType": "created,updated,deleted",
"clientState": null,
"notificationUrl": "https://XXXX.ngrok.io/notification/event",
"expirationDateTime": "2019-05-31T14:42:08.651Z",
"creatorId": "31c61efc-bc28-4552-9f0d-1a8735767c4e"
}
]
}
Monitoring the ngrok calls, there is no failing call to the notification events endpoint.
Is there any console log we can verify to understand what the problem could be?
We tried to create subscriptions for different accounts with no success.
We also tried to subcribe to /me/events
Just wondering if it could the cause, but the calendar id to whom you're subscribing to is ending with \u003d instead of =. Encoding stuff. Might not be it, but for me its working well with this.
Hope its just this!
JS
When I attempt to create a Microsoft Graph webhook subscription to the security/alerts endpoint, the subscription creation fails with a generic message as shown below. Modifying the resource to 'me/messages' results in a successful webhook subscription created, so this appears to be specific to the security/alerts endpoint. How do I move past this?
The body of the request is as such:
{
"changeType": "created",
"notificationUrl": "https://xxxxxxxxx.azurewebsites.net/api/graphnotifications",
"resource": "security/alerts?$filter=vendorInformation/provider+eq+'ASC'",
"expirationDateTime": "2018-11-15T11:00:00.0000000Z",
"clientState": "secretClientValue"
}
Please use 'updated' for 'changeType'. Security/Alerts uses 'updated' for all new or updated alerts.
Wes, you didn't post the URL that you sent that request to. As per the documentation for Security Alerts.
You can use Microsoft Graph webhooks to subscribe to and receive notifications about updates to Microsoft Graph Security entities.
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/security-api-overview
On that page, it states posting a request and gives a sample like this
POST https://graph.microsoft.com/v1.0/subscriptions
Content-Type: application/json
{
"changeType": "created,updated",
"notificationUrl": "https://webhook.azurewebsites.net/notificationClient",
"resource": "/me/mailfolders('inbox')/messages",
"expirationDateTime": "2016-03-20T11:00:00.0000000Z",
"clientState": "SecretClientState"
}
https://developer.microsoft.com/en-us/graph/docs/concepts/webhooks
Are you posting that request body to that url?