# ScormApi

## POST /api/v1/ScormApi/GetCmiData

> Gets data for the specified SCORM CMI fields based on the element names.> \
> Results are ordered alphabetically by SCO ID.> \
> Requires the View Section Enrollments permission in the enrollment organization or an ancestor.

```json
{"openapi":"3.1.1","info":{"title":"NexPort Web API","version":"v1"},"servers":[{"url":"https://www.nexportcampus.com"}],"paths":{"/api/v1/ScormApi/GetCmiData":{"post":{"tags":["ScormApi"],"summary":"Gets data for the specified SCORM CMI fields based on the element names.\r\nResults are ordered alphabetically by SCO ID.\r\nRequires the View Section Enrollments permission in the enrollment organization or an ancestor.","operationId":"ScormApi_GetCmiData","parameters":[{"schema":{"type":"integer","format":"int32"},"name":"page","in":"query","description":"Which page of results to start on","required":false},{"schema":{"type":"integer","format":"int32"},"name":"per_page","in":"query","required":false},{"schema":{"type":"string"},"name":"access_token","in":"query","description":"Use the AdminApi Authenticate method to get the access_token","required":true}],"responses":{"200":{"description":"List of SCOs and corresponding CMI data","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GetCmiDataResponseItem"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GetCmiDataResponseItem"}}}}},"403":{"description":"Not authorized to view CMI data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}},"text/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}}}},"409":{"description":"Entity not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}},"text/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}}}},"422":{"description":"Validation exception. See response body for more info.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}},"text/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCmiDataRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/GetCmiDataRequest"}}},"description":"Contains list of CMI element names","required":true}}}},"components":{"schemas":{"GetCmiDataResponseItem":{"title":"GetCmiDataResponseItem","description":"Contains list of CMI fields/values as well as start and end date for the attempt, the title, and the sco id","default":{"title":"Sample title","sco_id":"I_SCO0","start_date_utc":"2015-12-25T19:25:24.731+00:00","exit_date_utc":"2015-12-25T19:25:24.731+00:00","cmi_fields":[{"cmi_element_name":"cmi.core.lesson_status","cmi_element_value":"incomplete"},{"cmi_element_name":"cmi.core.exit"},{"cmi_element_name":"cmi.core.invalid_name","cmi_element_value":"","error_message":"401 - Not Implemented Error"}],"api_error_entity":{"error_code":0,"warning_messages":[]}},"required":["title","sco_id","cmi_fields","api_error_entity"],"type":"object","properties":{"title":{"description":"Title for the SCO","type":"string"},"sco_id":{"description":"ID for the SCO","type":"string"},"start_date_utc":{"format":"date-time","description":"When the student started this SCO","type":"string"},"exit_date_utc":{"format":"date-time","description":"When the student exited this SCO","type":"string"},"cmi_fields":{"description":"List of objects containing field name, field value, and error code if applicable","type":"array","items":{"$ref":"#/components/schemas/CmiField"}},"api_error_entity":{"$ref":"#/components/schemas/ApiErrorEntity","description":"Error information"}}},"CmiField":{"description":"Represents a SCO CMI field and the value, as well as error information if applicable","required":["cmi_element_name"],"type":"object","properties":{"cmi_element_name":{"description":"Name of the CMI Element","type":"string"},"cmi_element_value":{"description":"Value of the CMI Element. Empty string in the case of an error.\r\nValue will be excluded if it is null.","type":"string"},"error_message":{"description":"If an error occurred processing this element, then a message will be added.\r\nNull if no error occurred.","type":"string"}}},"ApiErrorEntity":{"description":"Model used to determine what, if anything, went wrong with an api request","required":["error_code"],"type":"object","properties":{"error_code":{"format":"int32","description":"Used to denote the kind of error that occurred, if any.\r\nNoError=0;\r\nUnknownError=1;\r\nValidationError=2;\r\nItemNotFound=3;\r\nAuthenticationError=4;\r\nAuthorizationError=5;0 = No Error, 1 = Unknown Error, 2 = Validation Error, 3 = Item Not Found, 4 = Authentication Error, 5 = Authorization Error, 6 = Subscription Not Found, 7 = Enrollment Already Exists, 8 = Subscription Already Exists","enum":[0,1,2,3,4,5,6,7,8],"type":"integer"},"error_message":{"description":"Message describing what caused the error to occur","type":"string"},"warning_messages":{"description":"Warning messages describing any  potential problems with the request that do not cause the request to fail","type":"array","items":{"type":"string"},"readOnly":true}}},"ApiResponseBase":{"title":"NexPort API Response","description":"Base class for api responses","default":{"api_error_entity":{"error_code":3,"error_message":"No entity found matching id in request","warning_messages":[]}},"required":["api_error_entity"],"type":"object","properties":{"api_error_entity":{"$ref":"#/components/schemas/ApiErrorEntity","description":"Error information"}}},"GetCmiDataRequest":{"description":"Contains information for filtering which SCORM CMI data to retrieve","required":["enrollment_id","assignment_id","cmi_element_names"],"type":"object","properties":{"enrollment_id":{"format":"uuid","description":"Id of the enrollment to get SCORM data for","type":"string"},"assignment_id":{"format":"uuid","description":"Id of the assignment to get SCORM data for","type":"string"},"cmi_element_names":{"description":"List of CMI element names to get data for","type":"array","items":{"type":"string"}}}}}}}
```

## POST /api/v1/ScormApi/EditScormData

> Edits data for a student's SCORM courseware attempt and corresponding history (if applicable)> \
> based on the supplied assignment status id and SCO id.> \
> If a field is not passed in, the value will remain unchanged.> \
> Requires the Update Section Enrollments permission in the assignment status enrollment> \
> organization or an ancestor.

```json
{"openapi":"3.1.1","info":{"title":"NexPort Web API","version":"v1"},"servers":[{"url":"https://www.nexportcampus.com"}],"paths":{"/api/v1/ScormApi/EditScormData":{"post":{"tags":["ScormApi"],"summary":"Edits data for a student's SCORM courseware attempt and corresponding history (if applicable)\r\nbased on the supplied assignment status id and SCO id.\r\nIf a field is not passed in, the value will remain unchanged.\r\nRequires the Update Section Enrollments permission in the assignment status enrollment\r\norganization or an ancestor.","operationId":"ScormApi_EditScormData","parameters":[{"schema":{"type":"string"},"name":"access_token","in":"query","description":"Use the AdminApi Authenticate method to get the access_token","required":true}],"responses":{"200":{"description":"Base error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditScormDataResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/EditScormDataResponse"}}}},"403":{"description":"Not authorized to edit SCORM data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}},"text/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}}}},"409":{"description":"Entity not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}},"text/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}}}},"422":{"description":"Validation exception","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}},"text/json":{"schema":{"$ref":"#/components/schemas/ApiResponseBase"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditScormDataRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/EditScormDataRequest"}}},"description":"Contains assignment status id, sco id, and relevant fields to edit","required":true}}}},"components":{"schemas":{"EditScormDataResponse":{"title":"EditScormDataResponse","description":"Simply returns the base response with error information if applicable","default":{"api_error_entity":{"error_code":3,"error_message":"No entity found matching id in request","warning_messages":[]}},"required":["api_error_entity"],"type":"object","properties":{"api_error_entity":{"$ref":"#/components/schemas/ApiErrorEntity","description":"Error information"}}},"ApiErrorEntity":{"description":"Model used to determine what, if anything, went wrong with an api request","required":["error_code"],"type":"object","properties":{"error_code":{"format":"int32","description":"Used to denote the kind of error that occurred, if any.\r\nNoError=0;\r\nUnknownError=1;\r\nValidationError=2;\r\nItemNotFound=3;\r\nAuthenticationError=4;\r\nAuthorizationError=5;0 = No Error, 1 = Unknown Error, 2 = Validation Error, 3 = Item Not Found, 4 = Authentication Error, 5 = Authorization Error, 6 = Subscription Not Found, 7 = Enrollment Already Exists, 8 = Subscription Already Exists","enum":[0,1,2,3,4,5,6,7,8],"type":"integer"},"error_message":{"description":"Message describing what caused the error to occur","type":"string"},"warning_messages":{"description":"Warning messages describing any  potential problems with the request that do not cause the request to fail","type":"array","items":{"type":"string"},"readOnly":true}}},"ApiResponseBase":{"title":"NexPort API Response","description":"Base class for api responses","default":{"api_error_entity":{"error_code":3,"error_message":"No entity found matching id in request","warning_messages":[]}},"required":["api_error_entity"],"type":"object","properties":{"api_error_entity":{"$ref":"#/components/schemas/ApiErrorEntity","description":"Error information"}}},"EditScormDataRequest":{"description":"Contains fields for editing a student's SCORM courseware attempt","required":["assignment_status_id","sco_id"],"type":"object","properties":{"assignment_status_id":{"format":"uuid","description":"Id of the assignment status to edit SCORM data for","type":"string"},"sco_id":{"description":"ScoId from GetCmiData","type":"string"},"title":{"description":"Title for the lesson","type":"string"},"start_date_utc":{"format":"date-time","description":"When this attempt was started","type":"string"},"exit_date_utc":{"format":"date-time","description":"When the user exited this attempt","type":"string"},"lesson_mode":{"description":"\"browse\", \"normal\", or \"review\"","type":"string"},"lesson_status":{"description":"This is the current student status as determined by the LMS system.\r\n\"passed\", \"completed\", \"failed\", \"incomplete\", \"browsed\", or \"not attempted\"","type":"string"},"lesson_location":{"description":"This corresponds to the point in the lesson at which the student exited the SCO.\r\nThis can be used to determine where the student will start the course the next time\r\nit is launched.","type":"string"},"exit_status":{"description":"Indicates how the learner left the SCO.\r\n\"normal\" or \"suspend\"","type":"string"},"session_time":{"description":"Identifies the amount of time the learner\r\nhas spent in the current instance of the\r\nSCO.","type":"string"},"total_time":{"description":"Stores the learner’s cumulative time for all\r\nsessions of a specific SCO for a given\r\nlearner attempt.","type":"string"},"raw_score":{"format":"float","description":"Number that reflects the performance of the learner","type":"number"},"suspend_data":{"description":"Provides space to store and retrieve data between learner sessions","type":"string"},"entry":{"description":"Indicates whether the learner has\r\npreviously accessed the SCO.\r\n\"ab-initio\", \"resume\", or \"\" (empty string)","type":"string"},"preference_language":{"description":"The student’s preferred language for SCOs with multilingual capability","type":"string"},"preference_speed":{"format":"int32","description":"The learner’s preferred relative speed of content delivery","type":"integer"},"for_credit":{"description":"Indicates whether the learner will be credited for performance in the SCO","type":"boolean"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexportsolutions.com/nexport-user-documentation/developer-documentation/campus-webapi/scormapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
