/getNextItems
Get next Items
Learnosity will call this endpoint on your self-hosted adaptive service to get the next Item(s) for a session.
This same endpoint is also called when the adaptive session is first initialized, to retrieve the first Item(s). In this case, the current_items
array will be present and empty.
HTTP method: POST
Request Body
Details of the session for which the new Items are requested.
Properties marked with are mandatory.
Content type: "application/json"
-
api_version string (uuid)
The version number of this API. Used to identify the format of the request payload, and that expected in the response.
Only valid, and required, at the root level of the request
Example:
v1.0.1
-
request_uuid string (uuid)
A unique identifier for the client's request, for tracing purposes. Useful for debugging and other investigations, as the identifier is shown to the client on error.
Only valid at the root level of the request
Example:
D32158D4-EB10-4D75-AC72-BA7292383D49
-
session_id string (uuid)
The session ID, used to uniquely identify a user session and group subsequent requests within the same assessment.
Example:
E439F6D7-15E4-4EBF-912F-EAA7CDB8171B
-
activity_id string (uuid)
The Activity ID, used to group Sessions which are taking the same Assessment.
Example:
B44D81BE-BCE9-48B1-8A62-89E7BF1C772F
-
user_id string (uuid)
The User ID, used to uniquely identify a given user across Sessions.
Example:
CCDD021C-6F96-41D0-96EB-406D564B0DD3
-
adaptive_activity object
The
adaptive
object from the Items APIrequest
object or Item Bank Activity Template, if applicable. This data is static for a given adaptive session, and will always contain the same data each time that session calls out to your adaptive backend.-
type string
The type of Adaptive engine to use (used by Items API). In this instance, only
selfhosted
is allowed.Example:
selfhosted
-
selfhosted_version_major int
The major version of the self-hosted Adaptive API supported by the Adaptive backend at
engine_url
.Example:
1
-
engine_url string (url)
The base URL (no trailing slash) of the endpoint implementing this API. This instructs Items API about where to send the getNextItems requests.
If unspecified, Items API will use the preconfigured URL for the Learnosity API Consumer.
Example:
https://adaptive.example.com/v1/adaptive
-
token_url string (url)
The URL of the endpoint offering an OAuth2 token from pre-shared client credentials.
If unspecified, Items API will use
/oauth2/token
on the base URL of the engine.Example:
https://authentication.example.com/oauth/adaptive/getToken
-
custom_config object
Configuration specific to your Adaptive backend. This should contain any configuration required by your algorithm to deliver the session.
Opaque to Learnosity
Example:{ "item_pool_id": "MATH-2018" }
-
required_tags array
Only Items matching these tags from the Item Bank will be considered for presentation to the user.
Note: This is also used to select Items for automatic inclusion in Item pools alongside the Activity
Example:[ { "type": "Grade", "name": "6" }, { "type": "Domain", "name": "Domain3" }, { "type": "Domain", "name": "Domain4" } ]
-
-
current_items array
All the Items already seen in the session. At the beginning of a session, the array should be present and empty.
Note: It is possible for Items to be removed from a session if a user resumes from an earlier save point.
-
reference string
Example:
item-abc-123
-
organisation_id integer
The organisation ID of the Item Bank
Example:
1
-
item_pool_id string
The reference of the Item Pool
Example:
MATH-2018
-
score number (float)
Example:
0.5
-
max_score number (float)
Example:
1
-
-
custom_state object
Container for optional custom state, persisted by Learnosity. The value provided here is the
custom_state
data currently persisted for this session. Set via thecustom_state
param of the most recent getNextItems response.
Response
A response payload containing a list of one or more Items that should be shown to the student next.
HTTP status code: 200
Content type: "application/json"
-
session_id string (uuid)
The session ID, used to uniquely identify a user session and group subsequent requests within the same assessment.
Example:
E439F6D7-15E4-4EBF-912F-EAA7CDB8171B
-
next_items array
The next Items to be added to the session.
-
reference string
Example:
item-abc-123
-
-
is_last_items boolean
Instructs Items API to terminate the session after these Items are completed. Default to false.
-
custom_state object
Container for optional custom state, persisted by Learnosity. The provided value will overwrite the
custom_state
data currently persisted for this session. This data will be sent in the next request to /getNextItems via thecustom_state
parameter.Opaque to Learnosity