Rest API
REST API HTTP INTERFACE
The table below describes the routes that the HTTP interface provides. This HTTP interface is available for all models in Learning Locker.
GET http://www.example.org/api/v2/MODEL_NAME
For example, to get a count of stores via this API, youād use the following route.
GET http://www.example.org/api/v2/lrs
To access this interface, you must additionally supply your Basic Auth details with each request in theĀ Authorization
Ā header. Your Basic Auth details can be found underĀ SettingsĀ >Ā Clients.
Method | Description |
---|---|
Gets a count of the models. | |
Gets a subset of the models. | |
Creates a model. | |
Gets a single model. | |
Creates or overwrites a model. | |
Creates or overwrites a model. | |
Patches a model. | |
Deletes a model. |
MODELS
The table below lists the models supported by this interface, you can view the model schemas by clicking the model names.
Name | API Model Name | Description |
---|---|---|
| Activity with many identifiers. | |
| Credentials that access HTTP Interfaces. | |
| Customisable grid of visualisations. | |
| Record of downloaded exports. | |
| Template for exporting statements. | |
| Journeys visualisation. | |
| Journey progress. | |
| Container of clients and stores that a subset of users can access. | |
| Person with manyĀ identifiersĀ andĀ attributesĀ across systems. | |
| Unique xAPI identifier for a persona. | |
| Attribute of a persona. | |
| Saved filter for statements. | |
| Group of permissions for accessing organisation data via users. | |
| Container for xAPI data (statements, documents, and attachments). | |
| Login details for accessing the UI. | |
| Graphical view of statements. |
ROUTES
GET /COUNT
This route returns a count of the models. A request to this route would look something like the request below.
GET http://www.example.org/api/v2/lrs/count
Authorization: Basic YOUR_BASIC_AUTH
A request like the one above, will respond with a 200 response like the one below containing a count of the models in the body.
For more information about the acceptable URL query parameters, view theĀ Restify documentation. Note that the limit parameter will default to 10 if not given and cannot exceed 1,000 if it is given.
Important:Ā In case ofĀ UserĀ route,Ā queryĀ parameter will be ignored andĀ search
Ā parameter should be used instead (only available in Enterprise).Ā search
Ā query parameter is a simple string and will be transformed into filter shown below.
GET /
This route returns an array of models. A request to this route would look something like the request below.
A request like the one above, will respond with a 200 response like the one below containing the models as JSON in the body. Different models will respond with a different schema, you can view the schemas by clicking the model names in theĀ model table above.
For more information about the acceptable URL query parameters, view theĀ Restify documentation.
Important:Ā In case ofĀ UserĀ route,Ā queryĀ parameter will be ignored andĀ search
Ā parameter should be used instead.Ā search
Ā query parameter is a simple string and will be transformed into filter shown below.
POST /
This route creates a model. A request to this route would look something like the request below. Different models will require and respond with a different schema, you can view the schemas by clicking the model names in theĀ model table above.
A request like the one above, will respond with a 201 response like the one below containing the created model in the JSON body.
GET /:ID
This route returns a single model that has the specified identifier from the URL. A request to this route would look something like the request below.
A request like the one above, will respond with a 200 response like the one below containing the model as JSON in the body. Different models will respond with a different schema, you can view the schemas by clicking the model names in theĀ model table above. Note that the request will return a 404 response if the model doesnāt exist.
For more information about the acceptable URL query parameters, view theĀ Restify documentation.
PUT OR POST /:ID
This route creates or updates a single model that has the specified identifier from the URL. A request to this route would look something like the request below. Different models will require and respond with a different schema, you can view the schemas by clicking the model names in theĀ model table above.
A request like the one above, will respond with a 200 response like the one below containing the model as JSON in the body.
PATCH /:ID
This route patches a single model that has the specified identifier from the URL. A request to this route would look something like the request below. Different models will require and respond with a different schema, you can view the schemas by clicking the model names in theĀ model table above.
A request like the one above, will respond with a 200 response like the one below containing the model as JSON in the body.
DELETE /:ID
This route deletes a single model that has the specified identifier from the URL. A request to this route would look something like the request below.
A request like the one above, will respond with a 204 response like the one below.
Ā
Learning Locker and the Squirrel logo are trademark of Learning Pool 2020 | Learning Locker is licensed under GPL 3.0.