Overview
Many clients have a need to integrate data from LearningBuilder into their 3rd party tools or APIs for reporting, auditing, or quality assurance purposes. Using the OData features in LearningBuilder, a System Administrator can easily expose a database table or SQL view using a standards-based RESTful API.
Built-in tables and views can be exposed with no custom programming at all. In more advanced cases, custom SQL views can be easily created and then exposed through the same configuration tools.
API Authentication
OData APIs are secured using API Keys, which should be passed in a HTTP Basic Authentication header.
For more details, see the API Key Authentication Use API Keys to authenticate API calls page.
API Endpoints
Info |
---|
title | List of available endpoints |
---|
|
https://<LearningBuilderUrl>/data
|
Info |
---|
title | List of available endpoints with metadata |
---|
|
https://<LearningBuilderUrl>/data/$metadata
|
Info |
---|
title | Endpoint for a specific resource (requires API Key) |
---|
|
https://<LearningBuilderUrl>/data/<entityName>
|
Row-level security via "Member ID Field"
A common requirement is to restrict the data exposed via the data feed so that callers only see the data they are authorized to see. This can be easily accommodated by identifying a specific column in the table or view as the "Member ID Field".
If a field is designated in this way, the LearningBuilder OData endpoint will automatically filter the results to include only rows where the designated column matches the owner of the API Key used to authenticate the request.
For example, to construct an OData feed that shows each Member a list of their own Applications:
- Construct a custom SQL view returning all Applications.
- In the Sys Admin → App Configuration → OData tool, create a new OData Entity with a name matching the view.
- Enter the name of the column, in the view, representing the owner's Member Id
When a caller authenticates to the API Endpoint with an API Key, the OData endpoint will then filter out all rows where the value in the specified column does not match the Owner Member Id associated with the API Key used on the request. Thus, the caller will only receive the data relevant to them/wiki/spaces/DOCS/pages/1685618730 requires assistance from a System Administrator.