# Data API - New Reporting API Expansion

LearningSpace’s **new Data API endpoints** no longer rely on the legacy raw data API. These **new endpoints** can be used to extract the same type of data on the same scale as the legacy data API.

Most customers who extract assessment data from LearningSpace require more generic options: a generic, flexible Data API solution that:

* follows modern technological and industry standards
* focuses on assessment data in LearningSpace
* replaces the legacy raw data API functionality


:::tip
This new Data API is the future, and we encourage customers to move away from the legacy, so-called Raw Data API.

:::

# **Technical Documentation**

## **Authentication**

Authentication via a JWT token obtained from the API key is available on the LearningSpace UI.


:::info
For more details, see:  [How to Generate a Data API key](/doc/c43e3994-8e68-4267-bf6a-71e0ce4a8d1b) 

:::

## **New API endpoints**

Three areas are targeted with new API endpoints:

* **__Responses__** → Item-level submitted evaluation data used by LearningSpace to calculate learner performance scores (case total scores, activity total scores, etc.).
* **__Comments__** → Scoring comments submitted during open-ended question scoring, along with the associated textual responses and points given. Formative feedback, comments, or any text submitted in text and structured text items.
* **__Items__** → Questions/items of evaluation checklists along with possible answer options and point values (not submitted data).

### **Response endpoints**

> * `/v1/assessment/activity/{ActivityID}/responses`
> * `/v1/assessment/activity/{ActivityID}/case/{CaseID}/responses`
> * `/v1/assessment/activity/{ActivityID}/case/{CaseID}/learner/{LearnerID}/responses`  
>     
>   `parameters: `  
>   `ActivityID: ID of the activity `
>
>   `CaseID: ID of the case `  
>   `LearnerID: ID of the user `  
>     
>   `columns: `  
>   `LearnerName: Full name of the user `  
>   `LearnerID: ID of the user `  
>   `LearnerUCID: UCID of the user `  
>   `LearnerACID: Additional custom ID of the user `  
>   `ActivityID: ID of the activity `  
>   `ActivityTitle: Title of the activity `  
>   `LearnerGroupID: Group ID of the activity `  
>   `CaseID: ID of the case `  
>   `CasePart: Name of the case part (e.g. Pre-Encounter, SP) `  
>   `CaseTitle: Title of the case `  
>   `QuestionID: ID of the question `  
>   `ScorePercentage: Percentage of achieved score per item `  
>   `AchievedPoints: Number of achieved points `  
>   `MaxAchievable: Number of max achievable points `  
>   `SectionID: ID of the section `  
>   `SectionTitle: Title of the section `  
>   `SectionAbbreviation: Short title of the section `  
>   `SectionWeight: Score weight of the section `  
>   `ActivityStartDate: Start date of the activity `  
>   `ActivityEndDate: End date of the activity `  
>   `AnswerText: The answer for a question given by the user `  
>   `VirtualSectionTags: Virtual section tags `  
>   `Client: Client type set for the activity `  
>   `SubmitID: ID of the submit `  
>   `SubmitDate: Date of the submit `  
>   `ItemComment: Comment submitted in item level comment box during data entry `  
>   `SubmitterID: ID of the submitter `  
>   `SubmitterUCID: UCID of the submitter `  
>   `SubmitterACID: Additional custom ID of the submitter `  
>   `SubmitterName: Full name of the submitter`


### **Items endpoints**

> * `/v1/assessment/activity/items`
> * `/v1/assessment/activity/{ActivityID}/items`
> * `/v1/assessment/activity/{ActivityID}/case/{CaseID}/items `  
>     
>   `parameters: `  
>   `ActivityID: ID of the activity `
>
>   `CaseID: ID of the case `  
>     
>   `columns: `
>
>   `ActivityTitle: Title of the activity `  
>   `ActivityID: ID of the activity `  
>   `CaseID: ID of the case `  
>   `CaseTitle: Title of the case `  
>   `CasePart: Name of the case part (e.g. Pre-Encounter, SP) `  
>   `SectionID: ID of the section `  
>   `SectionRank: Order of the section within the case part `  
>   `SectionTitle: Title of the section `  
>   `SectionAbbreviation: Short title or abbreviation of the section `  
>   `QuestionID: ID of the question `  
>   `QuestionPhrase: Question text or phrase `  
>   `QuestionRank: Order of the question within the section `  
>   `QuestionType: Question type name (e.g. Radiobutton, Drop-down) `  
>   `AnswerValue: Value of a possible answer option for the question `  
>   `AnswerDescription: Text or phrase for that answer option `  
>   `AnswerRank: Order of the answers within the question`  
>   `QuestionnaireItemPhrase: Phrase of the questionnaire item from the special section; NULL when the question does not use questionnaire scoring `  
>   `QuestionnaireItemRank: Order of the question within a special section`  
>   `MinScore: Minimum score for an OEQS question with direct scoring; NULL otherwise `  
>   `MaxScore: Maximum score for an OEQS question with direct scoring; NULL otherwise `  
>   `isHiddenCase: Whether the case is marked hidden in Case Manager ('true' or 'false')`


### Comments endpoints

> * `/v1/assessment/activity/{ActivityID}/case/{CaseID}/learner/{LearnerID}/comments `  
>     
>   `parameters: `  
>   `ActivityID: ID of the activity `  
>   `CaseID: ID of the case `  
>   `LearnerID: ID of the user `  
>     
>   `columns: `  
>   `LearnerName: Full name of the user `  
>   `LearnerID: Unique ID of the user `  
>   `LearnerUCID: UCID of the user `  
>   `LearnerACID: Additional custom ID of the user `  
>   `ActivityID: ID of the activity`  
>   `ActivityTitle: Title of the activity `  
>   `CaseID: ID of the case `  
>   `CaseTitle: Title of the case `  
>   `CasePart: Name of the specific part of the case to which the response belongs `  
>   `QuestionID: ID of the question `  
>   `QuestionPhrase: The text or phrase of the question `  
>   `AchievedPoints: Number of points the user achieved for the question `  
>   `SectionID: ID of the section `  
>   `SectionRank: Order of the section within the case part `  
>   `SectionTitle: Title of the section `  
>   `SectionAbbreviation: Short title of the section `  
>   `SubmitID: ID of the submit `  
>   `SubmitDate: Date of the submit `  
>   `SubmitterID: ID of the submitter `  
>   `SubmitterUCID: UCID of the submitter `  
>   `SubmitterACID: Additional custom ID of the submitter `  
>   `SubmitterName: Full name of the submitter `  
>   `AnswerText: The user's answer to the question `  
>   `Comment: Comment provided in OEQS for the learner's response `  
>   `isReportedCommentItem: Marked as a "Reported Comment Item" in case editor`


### **API Response Examples (mock data)**

> `Responses:`
>
> `{ `  
>   
> `"LearnerName":"bandi mid_name last_name", `  
> `"LearnerUID":146, "LearnerUCID":null, `  
> `"ActivityTitle":"Test OSCE", `  
> `"ActivityID":35, `  
> `"LearnerGroupID":130, `  
> `"CaseID":50, "CaseTitle":"Abdominal Pain",`  
> `"QuestionID":1005,`  
> `"ScorePercentage":0.9800000190734863,`  
> `"AchievedPoints":98, `  
> `"MaxAchievable":100, `  
> `"SectionTitle":"SP History", `  
> `"SectionAbbreviation":"SH", `  
> `"ActivityStartDate":"2026-01-21T00:00:00.000Z", `  
> `"ActivityEndDate":"2026-01-31T23:55:00.000Z", `  
> `"AnswerText":"A3", `  
> `"VirtualSectionTags":"HX" },`


> `Items:`  
> `{`  
> ` "ActivityTitle": "Test OSCE",`  
> ` "ActivityID": 111, `  
> ` "CaseID": 222, `  
> ` "CaseTitle": "Abdominal Pain", `  
> ` "SectionID": 3333, `  
> ` "SectionRank": 0, `  
> ` "SectionTitle": "SP History", `  
> ` "SectionAbbreviation": "SH", `  
> ` "CasePart": "SP Part", `  
> ` "QuestionID": 19354, `  
> ` "QuestionPhrase": "Past medical history", `  
> ` "QuestionRank": 14, `
>
> ` "QuestionType": "Drop-down (single select)", `
>
> ` "AnswerValue": 1, `
>
> ` "QuestionnaireItemPhrase": null, `
>
> ` "AnswerDescription": "Asks", `
>
> ` "AnswerRank": 0, `
>
> ` "QuestionnaireItemRank": null, `
>
> ` "MinScore": null, `
>
> ` "MaxScore": null, `
>
> ` "isHiddenCase": "true" `  
> `}`


> `Comments: `  
> `{`  
> `"LearnerName": "bandi mid_name last_name", `  
> `"LearnerUID": 146, `  
> `"LearnerUCID": null, `  
> `"ActivityTitle": "Test OSCE", `  
> `"ActivityID": 36, `  
> `"CaseID": 53, `  
> `"CaseTitle": "Abdominal Pain", `  
> `"QuestionID": 1086, `  
> `"QuestionPhrase": "Physical Exam Findings", `  
> `"AchievedPoints": 4, `  
> `"AnswerText": "34 yo male with abdominal pain admitted this morning...", `  
> `"Comment": "Physical exam well performed", `  
> `"CasePart": "SP", `  
> `"isReportedCommentItem": "true" `  
> `}`

### **Pagination Parameters**

* `total`: Total number of items
* `limit`: How many results per request (default is 100)
* `offset`: Where the results start (default is 0)

### **Search Parameters**

Search parameters can now be used in API calls. All values returned as columns can be used as search parameters for filtering. Example:

```javascript
/api/data/v1/assessment/activity/111/case/222/responses?LearnerUCID=1234567
```

Multiple search parameters can be used in a single API call.


:::tip
### **Getting Started**

The following parameters can be used in API calls:

* `ActivityID`
* `CaseID`
* `LearnerID`

These IDs correspond to internal LearningSpace identifiers and are not currently visible in the LearningSpace user interface. You need to match these IDs to their actual activities, cases, and learners in LearningSpace.

**Step 1**

Retrieve the list of ActivityIDs and CaseIDs using:

```javascript
/v1/assessment/activity/items
```

**Step 2**

Use the retrieved IDs in subsequent API calls to filter the dataset and retrieve data for specific:

* Activities
* Cases
* Learners

:::



:::warning
**Important information**

Event-level restrictions do not apply to these API endpoints. Data for all activities in LearningSpace can be extracted regardless of the event-level Data API access configured in the LearningSpace user interface.

:::


:::info
### **Differences between the NBOME student assessment endpoint and the new responses endpoint**

Although both API endpoints extract the **same type of data** from LearningSpace (evaluation data), there are a few differences: 

* No NBOME-specific terms are used in the dataset extracted via the responses endpoint.
* No event-level restrictions apply to the responses endpoint (“data api access” does not have to be enabled at the event level). In fact, having an event is not a requirement. If data entry is submitted within an Activity, it will be retrieved via the responses endpoint.
* The Responses endpoint does not require a certain event configuration (advanced scheduled event, learner, and SP assignments in place)
* Not only can assessment data generated by using SP and the Learner Post-Encounter checklist be extracted using the responses endpoint.

:::


:::success
[Data API - How-to Guide](/doc/8192c270-bbfd-4f6e-b188-e32be98cea88) 

[APIs in LearningSpace](/doc/8b3dc0ee-b9dc-45b8-8399-54c4e2d42882) 

:::

---

**Documents**

- [User Guide](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/user-guide-WPv4VxhtWB)
- [FAQ](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/faq-YoxOQOjvnY)
- [Training Videos](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/training-videos-D2ycsEwqPt)
- [Module Introduction Videos](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/module-introduction-videos-I6OQ6H7SUT)
- [Release Notes](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/release-notes-BcFFMsc0RV)
- [Distance Learning with LearningSpace](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/distance-learning-with-learningspace-eAfwW23Hxg)
- [Preventing Copy-Paste in LearningSpace](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/preventing-copy-paste-in-learningspace-sPD0IIUuk0)
- [Important Technical Notification Regarding Adobe Flash Player](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/important-technical-notification-regarding-adobe-flash-player-eQtMLwLmTJ)
- [iPad support - Technical information](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/ipad-support-technical-information-dLmeFvKofC)
- [TeamViewer Link](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/teamviewer-link-QyKZBMqUT9)
- [YouTube videos about LearningSpace](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/youtube-videos-about-learningspace-TMb3zdc0LC)
- [Customer Aftercare One-Pager](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/customer-aftercare-one-pager-GBWMe1BcfS)
- [Case Studies](https://kb.learningspace.elevatehealth.net/s/ent-hs/doc/case-studies-VcAbFqXSz7)