LMS365 provides an ability to subscribe to events that happen in the system. For example, you can subscribe to 'CourseEnrollment' event and add some custom tracking logic which will record who enrolls to your courses.
So how do you do that? You need to register a webhook with specific filter which represent events you're subscribing to.
Webhooks in LMS365 have been implemented based on ASP.NET WebHooks. It is a standard library that Microsoft uses for in ASP.NET framework.
The Webhook flow generally works as follows:
- The Webhook sender (LMS365) exposes events that a client can subscribe to. The events describe observable changes to the system, for example that a new data item has been inserted, that a process has completed, etc.
- The Webhook receiver (Customer endpoints) subscribes by registering a Webhook consisting of four things:
- A URI for where the event notification should be posted in the form of an HTTP POST request;
- A set of filters describing the particular events for which the Webhook should be fired;
- A secret key which is used to sign the HTTP POST request;
- Additional data which should be included in the HTTP POST request. This can for example be additional HTTP header fields or properties included in the HTTP POST request body.
- Once an event happens the matching Webhook registrations are found and HTTP POST requests are submitted. Typically, there are several tries to generate HTTP POST requests if for some reason the recipient is not responding or the HTTP POST request results in an error response.
LMS365 Webhooks Events
The events (filters) you can subscribe to at the moment are the following:
List of these events will be extended in future.
You can try it out in LMS365 Swagger
Register Custom Webhooks or Subscribe to an Event
You need to send a POST request to http://api.365.systems/webhooks/registrations
POST /webhooks/registrations/ HTTP/
Authorization: Basic <basic auth header>
Where WebHookUri is a valid custom web hook handler. To understand how LMS365 webhooks work and how to implement custom webhooks handler we encourage you to get acquainted with ASP.NET Web Hooks documentation.