Subscribe to events using webhooks

NIkhil Koshi 0 Reputation points
2024-07-30T07:17:17.5+00:00

We're using MS Graph Subscription for events via webhooks. We're only interested in reminder events and want to ignore all other event notifications like create / update of a calendar event.

  1. Is there a way to provide a filter condition to only subscribe for reminder events?
  2. Or in the event response / decrypted resource data is there a field which can be used for checking reminder resource type ?
Subscription subscription = new Subscription();
subscription.setChangeType("created,updated,deleted");
subscription.setNotificationUrl(notificationUrl);
subscription.setResource("/me/events?$select=id,subject,start,end,webLink,onlineMeetingUrl,reminderMinutesBeforeStart");
subscription.setExpirationDateTime(java.time.OffsetDateTime.now().plusDays(3));
subscription.setClientState(CLIENT_STATE);
subscription.setEncryptionCertificateId(certificateStore.getCertificateId());
subscription.setEncryptionCertificate(certificateStore.getBase64EncodedCertificate());
subscription.setIncludeResourceData(true);

subscription = graphClient.subscriptions()
        .post(subscription);
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,289 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.