Features endpoint
Manage Features in your Item bank.
Endpoints:
Usage
The format of requests to the Data API use the following syntax:
https://data.learnosity.com/{LTS_VERSION}/{endpoint}
For example, to use the v2025.1.LTS
version and the itembank/items
endpoint, you would create a request like so:
https://data.learnosity.com/v2025.1.LTS/itembank/items
Important Data API is not a REST API. All requests must use the POST method with the action
request body parameter specifying the operation to use. The Learnosity SDK must be used to make requests to Data API.
Note Data API usage is subject to rate limits.
Related articles:
- Getting Started with the Data API
- See Release Cadence and Version Lifecycle for more information on available LTS versions.
Get Features
Retrieves Features from your Item bank.
You would want to use this to extract existing Features (JSON format) to perform a backup or re-use them in your application, for example.
If item_references
are provided, Features associated with the provided Item reference(s) will be returned.
Note Any Questions associated with the provided references
or item_references
will not be returned from this endpoint. Instead, Questions can be retrieved using the dedicated itembank/questions endpoint.
Endpoint | /{LTS_VERSION}/itembank/features |
---|---|
HTTP method | POST |
Action type | "get" |
Request body parameters
Body content type: application/json
-
include object
(optional) Properties to be returned in the response.
-
features array[string]
(optional) Feature properties to be returned in the response.
Possible values
dt_created
dt_updated
-
-
organisation_id integer
Specifies the Item bank to retrieve Features from.
The API consumer making the request will need to have access to the Item bank. This access can be checked via the API consumers configuration in the Learnosity Console.
Default: the primary Item bank associated with the API consumer.
-
item_pool_id string
Return content from an Item pool instead of the Item bank.
-
item_references array[string]
(optional) Includes Features contained in at least one of the specified Items. Features associated with the provided Item reference(s) will be returned.
Maximum entries:
1000
-
content_search string
(optional) Includes Features which have the provided string in their content.
Note For performance reasons, please use this parameter with other filters, such as
types
. -
limit integer
Restricts the number of records returned.
Default:
50
-
next string
A token used to request the next page of results.
After making an initial request, if it would produce a result set larger than the specified
limit
, the return packet will include a token inmeta.next
. Pass the token provided bymeta.next
along with the original request parameters to retrieve the next page of results. -
references array[string]
A list of Feature references.
Maximum entries:
1000
-
sort string
Determines response sorting by ascending or descending order.
Default:
desc
Possible values
asc
desc
-
sort_field string
Specifies the time field to sort the results by.
Default:
created
Possible values
created
updated
-
types array[string]
Specifies the Feature types to retrieve.
See Question & Feature Codes for Data API filtering for a full list of Feature type codes.
Request body example
{ "types": ["calculator"] }
Responses
Response example
{ "meta": { "status":true, "timestamp":1389192595, "next": "1383057371.73016", "records": 100 }, "data": [ { "type": "calculator", "widget_type": "feature", "reference": "myfeature01", "data": { "type": "calculator", "mode": "basic" } }, ... ] }
Set Features
Creates or overwrites Features in your Item bank.
You would want to use this to bulk create new Features for use in Items or import content from another source, for example.
Important Existing Features with the same reference will be overwritten with the new properties.
Endpoint | /{LTS_VERSION}/itembank/features |
---|---|
HTTP method | POST |
Action type | "set" |
Request body parameters
Body content type: application/json
-
features array[object]
The Features you want to set, defined as a list of objects where each represents a separate Feature.
Maximum entries:
50
-
type string
Specifies the Feature type.
See Question & Feature Codes for Data API filtering for a full list of Feature type codes.
-
reference string
A unique reference for the Feature.
Must contain only letters, numbers, underscores, or dashes.
Maximum length:
150
-
data object
The raw Feature data (JSON).
See Feature Types for a list of all possible attributes for every Feature type.
Note The HTML markup will be automatically validated and any invalid tags or attributes may be removed for security purposes. See the list of supported HTML tags.
-
-
meta object
(optional) A metadata object which will be applied to all Features created in this request.
-
user object
(optional) Details of the user issuing this request. The user details are recorded in the audit trail for each of the new Features, and will be shown in Learnosity Author Site when viewing the history of changes on a Feature.
Default: Manual User/Data GUI
-
id string
The ID of the user issuing this request.
Important If the ID provided does not exist, a new user will be created. If the ID provided already exists, then all the attributes provided (
meta.user.firstname
,meta.user.lastname
, ormeta.user.email
) will overwrite the existing attributes.Note The user ID value is shown in the Learnosity Author Site audit trail if both
meta.user.firstname
andmeta.user.lastname
are not provided.Maximum length:
50
-
firstname string
(optional) First name of the user issuing the request. This first name is recorded in the audit trail for each of the new or modified Features.
Maximum length:
50
-
lastname string
(optional) Last name of the user issuing the request. This last name is recorded in the audit trail for each of the new or modified Features.
Maximum length:
50
-
email string
(optional) Email address of the user issuing the request. This email address is recorded in the audit trail for each of the new or modified Features.
Maximum length:
255
-
-
-
organisation_id integer
Specifies the Item bank to update.
The API consumer making the request will need to have access to the Item bank. This access can be checked via the API consumers configuration in the Learnosity Console.
Default: the primary Item bank associated with the API consumer.
Request body example
{ "features": [ { "type": "calculator", "reference": "myfeature01", "data": { "mode": "basic", "type": "calculator" } } ] }
Responses
Response example
{ "meta": { "status": true, "timestamp": 1396235761 }, "data": [] }
Duplicate Features
Duplicates Features in your Item bank.
You would want to use this to bulk duplicate many Features at once, to create the basis for a new annual assessment, for example.
Endpoint | /{LTS_VERSION}/itembank/features/duplicate |
---|---|
HTTP method | POST |
Action type | "set" |
Request body parameters
Body content type: application/json
-
organisation_id integer
Specifies the Item bank in which to read and duplicate the Features.
The API consumer making the request will need to have access to the Item bank. This access can be checked via the API consumers configuration in the Learnosity Console.
Default: the primary Item bank associated with the API consumer.
-
item_references array[string]
An array of Item references for which Features should be duplicated.
-
duplicate_shared_passages boolean
Specifies whether shared passages in Items will be duplicated. By default, shared passages are not duplicated and are referenced from the original Item instead.
Default:
false
-
meta object
(optional) A metadata object which will be applied to Features created in this request.
-
user object
(optional) Details of the user issuing this request. The user details are recorded in the audit trail for each of the new Features, and will be shown in Learnosity Author Site when viewing the history of changes on the Features.
Default: Manual User/Data GUI
-
id string
The ID of the user issuing this request.
Important If the ID provided does not exist, a new user will be created. If the ID provided already exists, then all the attributes provided (
meta.user.firstname
,meta.user.lastname
, ormeta.user.email
) will overwrite the existing attributes.Note The user ID value is shown in the Learnosity Author Site audit trail if both
meta.user.firstname
andmeta.user.lastname
are not provided.Maximum length:
50
-
firstname string
(optional) First name of the user issuing the request. This first name is recorded in the audit trail for each of the created Features.
Maximum length:
50
-
lastname string
(optional) Last name of the user issuing the request. This last name is recorded in the audit trail for each of the created Features.
Maximum length:
50
-
email string
(optional) Email address of the user issuing the request. This email address is recorded in the audit trail for each of the created Features.
Maximum length:
255
-
-
Request body example
{ "item_references": ["4bb30393-1fef-403b-ac5b-153bc9d1caf8"] }
Responses
Response example
{ "meta": { "status": true, "timestamp": 1512636002 }, "data": { "4bb30393-1fef-403b-ac5b-153bc9d1caf8": { "aa205cc7-402a-48e5-9cff-460c9f02fc24": { "type": "mcq", "widget_type": "response", "reference": "ef0c22cb-0d3e-4d36-ab34-26e25d65f337", "data": { "options": [ { "label": "[Choice A]", "value": "0" }, { "label": "[Choice B]", "value": "1" } ], "stimulus": "<p>[This is the stem.]</p>", "type": "mcq", "validation": { "scoring_type": "exactMatch", "valid_response": { "score": 1, "value": [ "" ] } }, "ui_style": { "type": "horizontal" } }, "metadata": { "name": "Multiple choice – standard", "template_reference": "9e8149bd-e4d8-4dd6-a751-1a113a4b9163" } } } } }