Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Subscription to change notifications through webhooks
NB: Creating a subscription requires read scope to the resource. For example, to get change notifications on messages, your app needs the Mail.Read
permission.
Currently, subscriptions are enabled for the following resources. Note: Subscriptions to resources marked with an asterisk (*) are supported on the /beta
endpoint only.
- An alert from the Microsoft Graph Security API.
- A baseTask (deprecated) of a user in Microsoft To-Do.*
- A callRecord produced after a call or meeting in Microsoft Teams.
- A channel in Microsoft Teams.
- A chat in Microsoft Teams.
- A chatMessage sent via teams or channels in Microsoft Teams.
- A conversation in a Microsoft 365 group.
- A conversationMember in a team, channel, or chat in Microsoft Teams.
- Content in the hierarchy of a root folder
DriveItem
in OneDrive for Business, or of a root folder or subfolderDriveItem
in a user's personal OneDrive. - A
Group
in Azure Active Directory. - A list under a SharePoint site.
- A message, event, or contact in Outlook.
- An online meeting in Microsoft Teams.*
- The presence of a user in Microsoft Teams.
- A team in Microsoft Teams.
- A printer (when a print job for the printer gets to JobFetchable state - ready to be fetched for printing) and a printTaskDefinition in Universal Print. For more information, see Subscribe to change notifications from cloud printing APIs.
- A todoTask of a user in Microsoft To Do (webhooks are only available in the worldwide endpoint and no other national clouds).
- A
User
in Azure Active Directory.
See https://learn.microsoft.com/en-us/graph/webhooks#supported-resources for an up to date list of resources that can produce change notifications
see https://learn.microsoft.com/en-us/graph/change-notifications-delivery-webhooks?tabs=http for protocol details
Synopsis
- createSubscription :: FromJSON b => Subscription -> AccessToken -> Req b
- data Subscription = Subscription {}
- data ChangeType
- data ChangeNotification a = ChangeNotification {
- cnChangeType :: ChangeType
- cnClientState :: Text
- cnId :: Text
- cnResource :: Text
- cnResourceData :: Maybe a
- cnSubscriptionId :: Text
- cnTenantId :: Text
Sender
:: FromJSON b | |
=> Subscription | Configuration of the change webhook to be created by this request |
-> AccessToken | |
-> Req b |
Create a subscription https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http
POST https://graph.microsoft.com/v1.0/subscriptions
NB: Creating a subscription requires read scope to the resource. For example, to get change notifications on messages, your app needs the Mail.Read
permission.
NB2: When you create a subscription to receive change notifications through webhooks, MS Graph first validates the notification endpoint that's provided in the notificationUrl
property of the subscription request. MS Graph encodes a validation token and includes it in a POST
request to the notification URL, the client must properly decode the URL to get the plain text validation token, and respond within 10 seconds. See https://learn.microsoft.com/en-us/graph/change-notifications-delivery-webhooks?tabs=http#notificationurl-validation for full details
types
data Subscription Source #
A subscription allows a client app to receive change notifications about changes to data in Microsoft Graph.
https://learn.microsoft.com/en-us/graph/api/resources/subscription?view=graph-rest-1.0
Subscription | |
|
Instances
data ChangeType Source #
the type of change in the subscribed resource that will raise a change notification.
Note:
- Drive root item and list change notifications support only the updated changeType.
- User and group change notifications support updated and deleted changeType. Use updated to receive notifications when user or group is created, updated or soft deleted. Use deleted to receive notifications when user or group is permanently deleted.
Instances
Receiver
types
data ChangeNotification a Source #
Represents the notification sent to the subscriber. https://learn.microsoft.com/en-us/graph/api/resources/changenotification?view=graph-rest-1.0
ChangeNotification | |
|