Templates - Endpoints - Data API

Templates endpoint

Create a standardized base learner session which can be used many times to generate empty sessions.

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:

Get Templates

Create a session template JSON, which is a standardized base learner session which can be used many times to generate empty sessions. This session template should correspond to a set of Items or an Activity. It can contain information such as the Items in the assessment, the scoring type to be used, subscore settings, and so on.

You would want to use this together with the SET /sessions endpoint to generate learner session data in order to test and preview your reports using Reports API, for example.

This endpoint can also be used to generate sessions for paper based assessments.

Note At this stage, there is no need to provide a user_id, activity_id, session_id, or adaptive object, because these details must be provided per session in the second part of this process when calling SET /sessions endpoint.

Endpoint /{LTS_VERSION}/sessions/templates
HTTP method POST
Action type "get"

Request body parameters

Body content type: application/json

  • activity_template_id string

    The Activity containing Items you want to use as a template for the session.

    See the Items API initialization option for more information.

  • items array[string] array[object]

    A list of Item references or Item objects to add to the session template.

    See the Items API initialization option for more information.

    Required except when activity_template_id is present.

  • item_pool_id string

    Specifies the Item pool from which to retrieve the Items or Activity template.

    See the Items API initialization option for more information.

  • organisation_id integer

    Specifies the Item bank from which to retrieve the Items or Activity template.

  • scoring_type string

    Overrides the scoring type of the Items loaded from the Item bank.

    See the Items API initialization option for more information.

  • subscores array[object]

    The subscore definition for the Activity.

    See the Items API initialization option for more information.

Request body example

{
    "activity_template_id": "demo-activity-1",
    "items": [ "demo-mcq-1" ]
}

Responses

Response example

{
    "meta": {
        "status": true,
        "timestamp": 1497929012,
        "records": 3
    },
    "data": {
        "items": [
            {
                "reference": "demo-mcq-1",
                "source": {
                    "reference": "demo-mcq-1",
                    "organisation_id": 1
                },
                "content": "<div class=\"row\"><div class=\"col-xs-12\"><span class=\"learnosity-response question-91c92c18e3725773844d8acaf12303ae\"></span></div></div>",
                "metadata": {
                    "acknowledgements": null,
                    "scoring_type": "per-question"
                },
                "workflow": [],
                "feature_ids": [],
                "question_ids": [
                    "91c92c18e3725773844d8acaf12303ae"
                ]
            }
        ],
        "metadata": {
            "items_api_version": "latest",
            "activity_template_id": "demo-activity-1"
        },
        "questions": [
            {
                "options": [
                    {
                        "label": "Cow",
                        "value": "0"
                    },
                    {
                        "label": "Horse",
                        "value": "1"
                    },
                    {
                        "label": "Chicken",
                        "value": "2"
                    },
                    {
                        "label": "Crocodile",
                        "value": "3"
                    }
                ],
                "stimulus": "Which of the following animals are mammals?",
                "type": "mcq",
                "multiple_responses": true,
                "validation": {
                    "scoring_type": "exactMatch",
                    "valid_response": {
                        "score": 1,
                        "value": [ "0", "1" ]
                    }
                },
                "ui_style": {
                    "type": "horizontal"
                },
                "metadata": {
                    "valid_response_count": 1,
                    "sheet_reference": "demo-mcq-1",
                    "widget_reference": "7578fd36-97ac-4648-babc-0b0d37b69e69",
                    "source": {
                        "organisation_id": 1
                    }
                },
                "id": "91c92c18e3725773844d8acaf12303ae"
            }
        ]
    }
}
Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.