Assets Endpoints
The Data API's assets
endpoint is used to retrieve secure pre-signed
URLs for media resources linked to learner responses for media-based question
types, such as video, audio, file uploads, etc.
To use this endpoint to retrieve a pre-signed URL, it must be supplied with the relative path to that asset. If this is unknown, then the relative path to a media asset can be retrieved using the Data APIs sessions/responses endpoint.
For more details about finding relative asset path, see the section How to find the asset path.
Usage
The format of requests to Data API use the following syntax:
https://data.learnosity.com/[LTS_VERSION]/assets
For example, to use the 2023.3.LTS version and the assets endpoint, you would create a request like so:
https://data.learnosity.com/v2023.3.LTS/assets
Assets
Endpoint | /[LTS_VERSION]/assets |
---|---|
HTTP Method | POST |
Action Type | get |
Parameter | Description |
asset_paths array[string] |
A list of relative media (asset) paths associated with learner responses to media-based question types, such as video, audio, file uploads, etc. Maximum: 50 asset paths.
Note
These relative paths can be retrieved via the Data API using
the |
expiry_duration integer |
Specifies the expiry time in seconds for the pre-signed URLs.
This will ensure the pre-signed URLs are active only for
a specified time frame.
|
Example
// Example request body { "asset_paths": [ "userupload/0034/questionresponse/2024/274/0034_8b175a19-63d7-476b-a4ee-532157f11b43_0034_8b175a19-63d7-476b-a4ee-532157f11b43_68e16400-1989-4ce9-9414-b5b46103241d_7ab31fa260ab8f069321dcec6776a506/2f556149-42f3-4ec0-82f2-d5c575df3f91.mp4", "0034/questionresponse/2024/274/0034_659658ff-fcfd-4ebe-94d2-348b21082741_53d6786a-bfd4-4096-8668-1293f1a0c5a0_9411b1e618d3c7efc96aa70c1f792380.v0", "userupload/0034/questionresponse/2024/274/0034_46bc12cc-2796-4f9b-a306-1394a4336812_0034_46bc12cc-2796-4f9b-a306-1394a4336812_952adc82-8420-41d9-bb50-08b4eec3a88a_88ef23637cf97b3d0a18c492c506696f/4dc16a1f-0b86-485a-bd69-df0171e28c87.jpg" ], "expiry_duration": 3600 } // Example response { "meta": { "status": true, "timestamp": 1735879695, "versions": { "requested": "latest", "mapped": "latest", "concrete": "latest" }, "records": 3 }, "data": [ { "asset_path": "userupload/0034/questionresponse/2024/274/0034_8b175a19-63d7-476b-a4ee-532157f11b43_0034_8b175a19-63d7-476b-a4ee-532157f11b43_68e16400-1989-4ce9-9414-b5b46103241d_7ab31fa260ab8f069321dcec6776a506/2f556149-42f3-4ec0-82f2-d5c575df3f91.mp4", "pre_signed_url": "https://s3.ap-southeast-2.amazonaws.com/learnosity-videooriginal-assess-dev/userupload/0034/questionresponse/2024/274/0034_8b175a19-63d7-476b-a4ee-532157f11b43_0034_8b175a19-63d7-476b-a4ee-532157f11b43_68e16400-1989-4ce9-9414-b5b46103241d_7ab31fa260ab8f069321dcec6776a506/2f556149-42f3-4ec0-82f2-d5c575df3f91.mp4?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3FP4W24DFYEWV6YY%2F20250103%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20250103T044815Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=a17677ab0c3cc0f89a87c962af36e422ab9127cc98b311cef85737d52d2e317d" }, { "asset_path": "0034/questionresponse/2024/274/0034_659658ff-fcfd-4ebe-94d2-348b21082741_53d6786a-bfd4-4096-8668-1293f1a0c5a0_9411b1e618d3c7efc96aa70c1f792380.v0", "pre_signed_url": { "mp3": "https://s3.ap-southeast-2.amazonaws.com/learnosity-mediaprocessed-dev/0034/questionresponse/2024/274/0034_659658ff-fcfd-4ebe-94d2-348b21082741_53d6786a-bfd4-4096-8668-1293f1a0c5a0_9411b1e618d3c7efc96aa70c1f792380.v0.mp3?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3FP4W24DFYEWV6YY%2F20250103%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20250103T044815Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=da696815328ccdc2aca1e301417e40dcedbca4feeb718fa827fce388f7ace5cd", "png": "https://s3.ap-southeast-2.amazonaws.com/learnosity-mediaprocessed-dev/0034/questionresponse/2024/274/0034_659658ff-fcfd-4ebe-94d2-348b21082741_53d6786a-bfd4-4096-8668-1293f1a0c5a0_9411b1e618d3c7efc96aa70c1f792380.v0.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3FP4W24DFYEWV6YY%2F20250103%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20250103T044815Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=167858b89ac977341c57009c45baf84780c777423820b8ba9ddfecd66874c409", "pkt.au": null } }, { "asset_path": "userupload/0034/questionresponse/2024/274/0034_46bc12cc-2796-4f9b-a306-1394a4336812_0034_46bc12cc-2796-4f9b-a306-1394a4336812_952adc82-8420-41d9-bb50-08b4eec3a88a_88ef23637cf97b3d0a18c492c506696f/4dc16a1f-0b86-485a-bd69-df0171e28c87.jpg", "pre_signed_url": "https://s3.ap-southeast-2.amazonaws.com/learnosity-mediaprocessed-dev/userupload/0034/questionresponse/2024/274/0034_46bc12cc-2796-4f9b-a306-1394a4336812_0034_46bc12cc-2796-4f9b-a306-1394a4336812_952adc82-8420-41d9-bb50-08b4eec3a88a_88ef23637cf97b3d0a18c492c506696f/4dc16a1f-0b86-485a-bd69-df0171e28c87.jpg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3FP4W24DFYEWV6YY%2F20250103%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20250103T044815Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=7128edff867dd6344c5edb5ff32c05cf98093b49f2c874a6cdb80ff4d8db3ad4" } ] }
How to find the asset path?
See the session Responses endpoint to understand how the responses are formatted.
To retrieve the asset path from the sessions/responses
endpoint, refer to each response
object in the responses
array in the below example of an endpoint response.
Note The relative asset path within a response is available only for media-type Questions, such as audio, video, file upload, image upload.
Below is a list of response
keys that contain the asset path for specific media Question types.
Type | Key |
audio | location |
video | assetProcessedPath |
file upload | assetPath |
image upload | asset |
// 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" } } ] }