Overview
Learn365 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 Learn365 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—Learn365—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
Please see the following article to get acquainted with the new LMS365 Connectors.
The events (filters) you can subscribe to at the moment are the following:
CourseEnrollment,
CourseUnenrollment,
CourseStarted,
CourseCompleted,
CoursePublished,
CourseUnpublished
EnrollmentApprovalRequest
List of these events will be extended in future.
You can try it out in Swagger.
Register custom webhooks or subscribe to an event
You need to send a POST request to https://api.365.systems/documentation/swaggerui3/#/WebHookRegistrations
For example:
POST /webhooks/registrations/ HTTP/
1.1
Host: api.
365
.systems
Authorization: Basic <basic auth header>
Content-Type: application/json
Cache-Control: no-cache
{
"Secret"
:
"some secret"
,
"Description"
:
"some description"
,
"IsPaused"
:
false
,
"Filters"
:[
"CourseCompleted"
]
}
Comments
Article is closed for comments.