Activity Sessions ================================================= Note: Every endpoint listed in this document is managing JSON objects, so the path structure shown for nested keys is represented in a JSON-style access pattern. Root Path: ``/api/v1/activity_esssions/`` Model ------------------------------------------------------ .. list-table:: API endpoint for retrieving learner data. :widths: 15 5 5 75 :header-rows: 1 :class: table-striped table-bordered table-hover * - Key - Type - Default - Description * - course - string - - * - user - string - - * - score - number - - * - completed - bool - false - * - passed - bool - false - * - attempt_open_until - datetime - - * - manual_audit_date - datetime - - * - custom - json - - * - session - string - - * - sub_identifier - string - - * - session_closed - bool - - List ---- Return a list of this collection's items, matching the filter parameters if provided. HTTP Verb: ``GET`` Endpoint: ``/api/v1/activity_sessions/`` Example Request (cURL):: curl -X GET -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" https://.enfixlp.com/api/v1/activity_sessions/ Example Response:: [ { "_id": "54ac1e5140df567c3297d4b8", "date_added": "2015-01-06 12:41:37", "manual_audit_date": null, "date_updated": "2015-01-06 12:41:37", "sub_identifier": "", "attempt_open_until": null, "passed": true, "completed": false, "session_closed": false, "course": "53473891a64c9e7c66b2390b", "session": "", "score": 101, "custom": {}, "user": "51b1e833bd7a844089b652aa" }, { "_id": "56b012547bb6b18a0dad6ddd", "score": 82, "attempt_open_until": null, "date_updated": "2016-02-01 21:20:27", "sub_identifier": "51b1e833bd7a844089b652aa_testerf", "session_closed": false, "custom": { "scorm_data": "{\"cmi.core.score.max\": \"\", \"cmi.comments_from_lms\": \"No comment\", \"cmi.comments\": \"\", \"cmi.core.score.raw\": \"82\", \"cmi.core.student_id\": \"51b1e833bd7a844089b652aa\", \"cmi.student_preference.language\": \"\", \"cmi.student_preference.text\": \"\", \"cmi.core.lesson_location\": \"\", \"cmi.student_preference.speed\": \"\", \"cmi.launch_data\": \"\", \"cmi.student_preference.audio\": \"\", \"cmi.core.score.min\": \"\", \"cmi.core.total_time\": \"0000:00:00\", \"cmi.student_data.mastery_score\": \"\", \"cmi.core.credit\": \"credit\", \"cmi.core.entry\": \"\", \"cmi.objectives._count\": \"0\", \"cmi.student_data.max_time_allowed\": \"\", \"cmi.core.student_name\": \"gav163\", \"cmi.interactions._count\": \"0\", \"cmi.core.lesson_status\": \"passed\", \"cmi.student_data.time_limit_action\": \"\", \"cmi.core.lesson_mode\": \"normal\", \"cmi.suspend_data\": \"\"}" }, "course": "51d5d55dbd7a84058e7bf61c", "session": "", "user": "51b1e833bd7a844089b652aa", "passed": true, "manual_audit_date": null, "date_added": "2016-02-01 21:20:04", "completed": false } ] Get One ------- Return the specified collection item. HTTP Verb: ``GET`` Endpoint: ``/api/v1/activity_sessions/[id]`` Example Request (cURL):: curl -X GET -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" https://.enfixlp.com/api/v1/activity_sessions/[id] Example Response:: { "_id": "56b012547bb6b18a0dad6ddd", "score": 82, "attempt_open_until": null, "date_updated": "2016-02-01 21:20:27", "sub_identifier": "51b1e833bd7a844089b652aa_testerf", "session_closed": false, "custom": { "scorm_data": "{\"cmi.core.score.max\": \"\", \"cmi.comments_from_lms\": \"No comment\", \"cmi.comments\": \"\", \"cmi.core.score.raw\": \"82\", \"cmi.core.student_id\": \"51b1e833bd7a844089b652aa\", \"cmi.student_preference.language\": \"\", \"cmi.student_preference.text\": \"\", \"cmi.core.lesson_location\": \"\", \"cmi.student_preference.speed\": \"\", \"cmi.launch_data\": \"\", \"cmi.student_preference.audio\": \"\", \"cmi.core.score.min\": \"\", \"cmi.core.total_time\": \"0000:00:00\", \"cmi.student_data.mastery_score\": \"\", \"cmi.core.credit\": \"credit\", \"cmi.core.entry\": \"\", \"cmi.objectives._count\": \"0\", \"cmi.student_data.max_time_allowed\": \"\", \"cmi.core.student_name\": \"gav163\", \"cmi.interactions._count\": \"0\", \"cmi.core.lesson_status\": \"passed\", \"cmi.student_data.time_limit_action\": \"\", \"cmi.core.lesson_mode\": \"normal\", \"cmi.suspend_data\": \"\"}" }, "course": "51d5d55dbd7a84058e7bf61c", "session": "", "user": "51b1e833bd7a844089b652aa", "passed": true, "manual_audit_date": null, "date_added": "2016-02-01 21:20:04", "completed": false } Create ------ Store a new instance of the object in the system. All required fields must be specified. HTTP Verb: ``POST`` Endpoint: ``/api/v1/activity_sessions/`` Example Request (cURL):: curl -X POST -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" -d '{"course": "51d5d55dbd7a84058e7bf61c", "user": "51b1e833bd7a844089b652aa"}' https://.enfixlp.com/api/v1/activity_sessions/ Example Response:: { "resource_url": "https://.enfixlp.com/api/v1/activity_sessions/51b1e78dbd7a844089b652a9/", "_id": "51b1e78dbd7a844089b652a9" } Replace ------- This is a full model replacement of the specified item, every required field must be specified. HTTP Verb: ``PUT`` Endpoint: ``/api/v1/activity_sessions/[id]`` Example Request (cURL):: curl -X PUT -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" -d '{"course": "51d5d55dbd7a84058e7bf61c", "user": "51b1e833bd7a844089b652aa"}' https://.enfixlp.com/api/v1/activity_sessions/[id] Example Response:: No body, Status Code 204. Update ------ On an update, you may specify only the fields you wish to update. All other fields will be preserved as currently stored. HTTP Verb: ``PATCH`` Endpoint: ``/api/v1/activity_sessions/[id]`` Example Request (cURL):: curl -X PUT -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" -d '{"passed": false}' https://.enfixlp.com/api/v1/activity_sessions/[id] Example Response:: No body, Status Code 204. Delete ------ Permanently remove an item from the collection. HTTP Verb: ``DELETE`` Endpoint: ``/api/v1/activity_sessions/[id]`` Example Request (cURL):: curl -X DELETE -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" https://.enfixlp.com/api/v1/activity_sessions/[id] Example Response:: No body, Status Code 200.