HTTP Interfaces (APIs)
Indexes
As you’ll see through the documentation of our HTTP interfaces, it’s important to ensure you’re hitting an index. Single Tenant Enterprise users can use the following request to find the available indexes.
GET http://www.example.org/api/indexes/MODEL_NAME
For example, to find the indexes available for the Statement model, you can use the following request.
GET https://saas.learninglocker.net/api/indexes/statement
Understanding the API via the UI
Everything you can do in the UI, can also be done via the API. Open up the dev tools in the browser, switch to the Network panel, then do the action you want in the UI and observe the API requests that complete the action in the Network panel.
You may notice that some parts of the API (like adding organisation roles to users) currently only support user-based authentication rather than client-based authentication. Should you need to use these APIs right now, you can actually get a JWT token for the user and use that to authenticate. Look at the login flow in the network panel, and pay attention to the JWT we return when you login AND when you access an org. Those are the bearer tokens (depending on whether you are at the site, or org level). See Administrator level authentication flow for more information.
Postman
Below are details of the Postman Collections and Environment that you can use.
Collections
Below are some of the Postman Collections we use internally to test and demonstrate Learning Locker’s APIs.
You can import a collection file. Click on the ‘Import’ button on the top bar, and paste a URL (use the links above) to the collection, or the collection JSON itself, and click ‘Import’.
Environment
We recommend that you use a Postman Environment to utilise our collections. Each of your environments need the variables below.
auth
version
baseUrl
iri
mbox
id
To get started please create a new Postman Enviroment, then modify your environment and select “Bulk edit”. Once inside the bulk edit you can copy the code below and paste it into Postman. Please change YOUR_AUTH
to your base 64 encoded basic auth details (which can be found under “Manage clients” on the left, inside an LRS on Learning Locker), and YOUR_ENDPOINT
to your LL endpoint (the origin).
auth: YOUR_AUTH
version: 1.0.1
baseUrl: YOUR_ENDPOINT
iri: http://www.example.com
mbox: mailto:ex@mple.com
id: fd590b50-cbc3-11e4-8830-0800200c9a66
Learning Locker and the Squirrel logo are trademark of Learning Pool 2020 | Learning Locker is licensed under GPL 3.0.