Before you begin consuming events produced by LearningStudio, it is necessary to perform some one-time set up tasks.
Set Up a Web Server
In order for LearningStudio to deliver events, you must have a web server set up and ready to receive those events. LearningStudio delivers events over HTTP/HTTPS, so your server must listen on port 80 and 443. Your server can listen on any publicly available URL, which you’ll provide to us when you subscribe to events.
Request a Principal
A principal is an application registration tracked by Pearson. In order to create a principal, send the following information via email to firstname.lastname@example.org.
- Application name and/or purpose. Provide a brief overview of the function of your application and how it will use eventing.
- Web Server Domain. The domain belonging to your web server that will listen for subscribed events related to this principal. If your web server intends to listen on multiple domains, you can include a wildcard mask here, for example, “*.pearson.com”. When you create a subscription for a certain type of event, you’ll provide us with the full URL, including the domain and route. That URL must match the domain or wildcard mask you provide here.
Once we receive your principal request, we will set up your principal and notify you when it is ready. Our response will include a Principal ID and a secret key, which you’ll use to create subscriptions.
Important: Keep this information secure! Anyone with access to your Principal ID and secret key will be able to create and delete subscriptions, and read the messages LearningStudio delivers to your application.
Once your principal is set up, you can subscribe to any event type published by LearningStudio. The events to which you can subscribe are found in the Event Contracts section.
Subscriptions are created with a RESTful API request, and LearningStudio also provides API requests to retrieve a list of your current subscriptions as well as delete a subscription. When you create a subscription, you will include the URL where we should deliver events of that type. This URL must match the Web Server Domain indicated when you requested your principal, and must be publicly accessible via port 80 and 443 in order for LearningStudio to communicate via HTTPS.
See Subscriptions for detailed instructions on how to use the Event API to manage your subscriptions.