Assets - Endpoints - Data API

Assets endpoint

Retrieve secure pre-signed URLs for media resources linked to learner responses for media-based Question types, such as Audio recorder, Video recorder, File upload, and Image upload.

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:

Retrieve pre-signed URLs for media assets

To retrieve a pre-signed URL, the relative path to the asset must be supplied. If this is unknown, then the relative path to a media asset can be retrieved using the Data API's sessions/responses endpoint.

The relative asset path is available in the Question response for media-type Question types only. Each of these Question types have a different response format. Below is a list of response object keys containing an asset path for the specific Question types:

See the session Responses endpoint to retrieve the session responses.

// Example - sessions/responses Response
{
    "meta": {
        "status": true,
        "timestamp": 1736942649,
        "next": "1729854752.211087",
        "versions": {
            "requested": "latest",
            "mapped": "latest",
            "concrete": "latest"
        },
        "records": 1
    },
    "data": [
        {
            "user_id": "c51be37f-254a-46fa-b447-0db7852afe75",
            "activity_id": "test-secure-url-media",
            "num_attempted": 4,
            "num_questions": 4,
            "session_id": "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1",
            "score": 0,
            "max_score": 3,
            "subscores": null,
            "session_duration": 74,
            "status": "Completed",
            "dt_event": "2024-10-25T11:12:32Z",
            "dt_saved": "2024-10-25T11:12:30Z",
            "dt_started": "2024-10-25T09:58:40Z",
            "dt_completed": "2024-10-25T11:12:30Z",
            "responses": [
                {
                    "response_id": "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_807d97b39f0245501f1734ed197c821e",
                    "question_type": "video",
                    "dt_score_updated": "2024-10-25T11:12:31Z",
                    "automarkable": false,
                    "attempted": true,
                    "score": null,
                    "max_score": 1,
                    "question_reference": "f924679e-1c3c-46a1-881a-ea51fc599ca7",
                    "item_reference": "539b36fb-741e-40d9-9e05-c372c90beed0",
                    "response": {
                        "type": "video",
                        "apiVersion": "latest",
                        "revision": 1,
                        "value": {
                            "name": "0034_c51be37f-254a-46fa-b447-0db7852afe75_b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_807d97b39f0245501f1734ed197c821e_1.mp4",
                            "description": "",
                            "originalName": "0034_c51be37f-254a-46fa-b447-0db7852afe75_b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_807d97b39f0245501f1734ed197c821e_1.mp4",
                            "extension": "mp4",
                            "size": 313982,
                            "assetPath": "userupload/0034/questionresponse/2024/298/0034_c51be37f-254a-46fa-b447-0db7852afe75_0034_c51be37f-254a-46fa-b447-0db7852afe75_b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_807d97b39f0245501f1734ed197c821e/0227ba7b-db5c-4890-9619-97b7a76a24e9.mp4",
                            "assetProcessedPath": "userupload/0034/questionresponse/2024/298/0034_c51be37f-254a-46fa-b447-0db7852afe75_0034_c51be37f-254a-46fa-b447-0db7852afe75_b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_807d97b39f0245501f1734ed197c821e/0227ba7b-db5c-4890-9619-97b7a76a24e9.mp4",
                            "srcType": "video/mp4",
                            "duration": 5.01
                        },
                        "created": "2024-10-25T10:00:31.553Z"
                    }
                },
                {
                    "response_id": "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_48f9bba2cfd28fb313e6e1e5e337a8bd",
                    "question_type": "audio",
                    "dt_score_updated": "2024-10-25T11:12:31Z",
                    "automarkable": false,
                    "attempted": true,
                    "score": null,
                    "max_score": 1,
                    "question_reference": "dee822b3-6669-48af-8032-3838c8086ad0",
                    "item_reference": "2fab6c8e-83ac-44a2-9534-d59939f91562",
                    "response": {
                        "location": "0034/questionresponse/2024/298/0034_c51be37f-254a-46fa-b447-0db7852afe75_b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_48f9bba2cfd28fb313e6e1e5e337a8bd.v0",
                        "type": "audio+png",
                        "length": 14080,
                        "created": "2024-10-25T10:02:06.193Z",
                        "apiVersion": "latest",
                        "revision": 1
                    }
                },
                {
                    "response_id": "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_0fa87a79fd2aa6717ab315e587e62732",
                    "question_type": "fileupload",
                    "dt_score_updated": "2024-10-25T11:12:31Z",
                    "automarkable": false,
                    "attempted": true,
                    "score": null,
                    "max_score": 1,
                    "question_reference": "9538b579-cf0c-46fa-86f4-ce38905041a3",
                    "item_reference": "6b2efdb7-ae56-4024-b47e-baf8e637827a",
                    "response": {
                        "value": [{
                            "name": "test3.png",
                            "description": "",
                            "originalName": "test3.png",
                            "extension": "png",
                            "size": 13198,
                            "assetPath": "userupload/0034/questionresponse/2024/298/0034_c51be37f-254a-46fa-b447-0db7852afe75_0034_c51be37f-254a-46fa-b447-0db7852afe75_b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_0fa87a79fd2aa6717ab315e587e62732/4c87bd19-9508-4dad-9316-5330906c0d28.png"
                        }],
                        "type": "array",
                        "apiVersion": "latest",
                        "revision": 1
                    }
                },
                {
                    "response_id": "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_a438420782ca4f66e6b206a9fbe8f408",
                    "question_type": "imageupload",
                    "dt_score_updated": "2024-10-25T11:12:31Z",
                    "automarkable": false,
                    "attempted": true,
                    "score": null,
                    "max_score": null,
                    "question_reference": "509af11e-5488-43d1-87a1-de82c943ac10",
                    "item_reference": "08c7d8bf-c738-420f-b2d3-7f1ef8996dd8",
                    "response": {
                        "value": {
                            "aspectRatio": 1.2725344644750796,
                            "asset": "userupload/0034/questionresponse/2024/298/0034_c51be37f-254a-46fa-b447-0db7852afe75_0034_c51be37f-254a-46fa-b447-0db7852afe75_b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_a438420782ca4f66e6b206a9fbe8f408/97343399-8c9f-4db4-83b3-7fa38c91a14d.jpeg"
                        },
                        "type": "object",
                        "apiVersion": "latest",
                        "revision": 1
                    }
                }
            ],
            "items": [
                {
                    "reference": "539b36fb-741e-40d9-9e05-c372c90beed0",
                    "source": {
                        "reference": "539b36fb-741e-40d9-9e05-c372c90beed0",
                        "organisation_id": 1
                    },
                    "time": 94,
                    "response_ids": [
                        "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_807d97b39f0245501f1734ed197c821e"
                    ],
                    "user_flagged": false,
                    "attempt_status": "fully_attempted",
                    "scoring": {
                        "score": null,
                        "max_score": 1,
                        "type": "per-question",
                        "max_score_of_attempted": 1,
                        "max_score_of_unmarked": 1,
                        "meta": {
                            "scoring_version_used": "v999.99.9"
                        },
                        "attempted": true,
                        "unmarked": true
                    }
                },
                {
                    "reference": "2fab6c8e-83ac-44a2-9534-d59939f91562",
                    "source": {
                        "reference": "2fab6c8e-83ac-44a2-9534-d59939f91562",
                        "organisation_id": 1
                    },
                    "time": 60,
                    "response_ids": [
                        "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_48f9bba2cfd28fb313e6e1e5e337a8bd"
                    ],
                    "user_flagged": false,
                    "attempt_status": "fully_attempted",
                    "scoring": {
                        "score": null,
                        "max_score": 1,
                        "type": "per-question",
                        "max_score_of_attempted": 1,
                        "max_score_of_unmarked": 1,
                        "meta": {
                            "scoring_version_used": "v999.99.9"
                        },
                        "attempted": true,
                        "unmarked": true
                    }
                },
                {
                    "reference": "6b2efdb7-ae56-4024-b47e-baf8e637827a",
                    "source": {
                        "reference": "6b2efdb7-ae56-4024-b47e-baf8e637827a",
                        "organisation_id": 1
                    },
                    "time": 639,
                    "response_ids": [
                        "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_0fa87a79fd2aa6717ab315e587e62732"
                    ],
                    "user_flagged": false,
                    "attempt_status": "fully_attempted",
                    "scoring": {
                        "score": null,
                        "max_score": 1,
                        "type": "per-question",
                        "max_score_of_attempted": 1,
                        "max_score_of_unmarked": 1,
                        "meta": {
                            "scoring_version_used": "v999.99.9"
                        },
                        "attempted": true,
                        "unmarked": true
                    }
                },
                {
                    "reference": "08c7d8bf-c738-420f-b2d3-7f1ef8996dd8",
                    "source": {
                        "reference": "08c7d8bf-c738-420f-b2d3-7f1ef8996dd8",
                        "organisation_id": 1
                    },
                    "time": 25,
                    "response_ids": [
                        "b5b28c56-13aa-4f03-8aa2-24f6a6273ba1_a438420782ca4f66e6b206a9fbe8f408"
                    ],
                    "user_flagged": false,
                    "attempt_status": "fully_attempted",
                    "scoring": {
                        "score": null,
                        "max_score": null,
                        "type": "per-question",
                        "max_score_of_attempted": 0,
                        "max_score_of_unmarked": 0,
                        "meta": {
                            "scoring_version_used": "v999.99.9"
                        },
                        "attempted": true,
                        "unmarked": true
                    }
                }
            ],
            "metadata": {
                "items_api_version": "latest",
                "max_time": 0,
                "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
            }
        }
    ]
}
Endpoint /{LTS_VERSION}/assets
HTTP method POST
Action type "get"

Request body parameters

Body content type: application/json

  • asset_paths array[string]

    A list of relative media (asset) paths associated with learner responses to media-based Question types.

    Note These relative paths can be retrieved via the Data API using the sessions/responses endpoint.

    Maximum entries: 50

  • expiry_duration integer

    Specifies the expiry time in seconds for the pre-signed URLs. The pre-signed URLs will only be active for the specified duration.

    The duration can be set between 1 minute and 7 days.

    Minimum: 60

    Maximum: 604800

Request body example

{
    "asset_paths": [
        "userupload/0034/questionresponse/2024/274/example1.mp4",
        "0034/questionresponse/2024/274/example2.v0",
        "userupload/0034/questionresponse/2024/274/example3.jpg"
    ],
    "expiry_duration": 3600 // 1 hour
}

Responses

Response example

{
    "meta": {
        "status": true,
        "timestamp": 1735879695,
        "versions": {
            "requested": "latest",
            "mapped": "latest",
            "concrete": "latest"
        },
        "records": 3
    },
    "data": [
        {
            "asset_path": "userupload/0034/questionresponse/2024/274/example1.mp4",
            "pre_signed_url": "https://s3.ap-southeast-2.amazonaws.com/example-url.mp4"
        },
        {
            "asset_path": "0034/questionresponse/2024/274/example2.v0",
            "pre_signed_url": {
                "mp3": "https://s3.ap-southeast-2.amazonaws.com/example-url.mp3",
                "png": "https://s3.ap-southeast-2.amazonaws.com/example-url.png",
                "pkt.au": null
            }
        },
        {
            "asset_path": "userupload/0034/questionresponse/2024/274/example3.jpg",
            "pre_signed_url": "https://s3.ap-southeast-2.amazonaws.com/example-url.jpg"
        }
    ]
}
Was this article helpful?

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