> For the complete documentation index, see [llms.txt](https://apidocs.d6plus.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.d6plus.co.za/reference/curriculum+/learner/get-learner-assessment-marks.md).

# Get Learner Assessment Marks

### Get the assessment marks records for a learner or grade

<mark style="color:blue;">`GET`</mark> `https://integrate.d6plus.co.za/api/v1/currplus/learnerassessmentmarks/{school_login_id}`

Use this endpoint to fetch the individual assessment marks for the specified learner or grade, for the specified school.\
The results are grouped per grade, per year, per term, per learner, per subject, per learning outcome, with the assessments listed under each learning outcome.\
At least one of the `learner_id` or `grade_id` query parameters must be provided. If no `year` is provided, the current d6+ administrative year is used.\
Assessment marks are only included once the marks for the learning program have been released (the learning program's mark release date, or the end of the term if no release date is set). Use the `structure` parameter to retrieve the assessment structure (assessments, dates and weights) without any marks.

**Path Parameters**

| Name                                                | Type    | Description                                      |
| --------------------------------------------------- | ------- | ------------------------------------------------ |
| school\_login\_id<mark style="color:red;">\*</mark> | Integer | The login ID of the school to retrieve data from |

**Query Parameters**

| Name                  | Type    | Description                                                                              |
| --------------------- | ------- | ---------------------------------------------------------------------------------------- |
| learner\_id           | Integer | The ID of a specific learner. Required if `grade_id` is not provided                     |
| grade\_id             | Integer | The ID of a specific grade. Required if `learner_id` is not provided                     |
| subject\_id           | Integer | Only return marks for the specified subject                                              |
| year                  | Integer | The administrative year to return marks for. Defaults to the current administrative year |
| term                  | Integer | Only return marks for the specified term                                                 |
| learning\_outcome\_id | Integer | Only return marks for the specified learning outcome                                     |
| assessment\_id        | Integer | Only return marks for the specified assessment                                           |
| structure             | Boolean | When set to 1, only the assessment structure is returned, without any marks              |

**Headers**

| Name                                              | Type   | Description       |
| ------------------------------------------------- | ------ | ----------------- |
| HTTP-X-USERNAME<mark style="color:red;">\*</mark> | String | As provided by d6 |
| HTTP-X-PASSWORD<mark style="color:red;">\*</mark> | String | As provided by d6 |

{% tabs %}
{% tab title="200 The request was successful." %}

```json
{
    "7": {
        "grade": "5",
        "years": {
            "2026": {
                "year": "2026",
                "year_name": "2026",
                "terms": {
                    "1": {
                        "term": "1",
                        "learners": {
                            "1": {
                                "learner_id": "1",
                                "subjects": {
                                    "327": {
                                        "subject_id": "327",
                                        "subject_name": "Mathematics (Gr 05)",
                                        "learning_outcomes": {
                                            "12": {
                                                "learning_outcome_id": "12",
                                                "learning_outcome_name": "Numbers, Operations and Relationships",
                                                "assessments": {
                                                    "45": {
                                                        "assessment_id": "45",
                                                        "assessment_name": "Test 1",
                                                        "assessment_date": "2026-03-15",
                                                        "weight": "40.00",
                                                        "dtime": "2026-03-20 10:15:00",
                                                        "percentage": "75.00",
                                                        "mark": "30.00",
                                                        "mark_out_of": "40.00",
                                                        "captured": "1"
                                                    },
                                                    "46": {
                                                        "assessment_id": "46",
                                                        "assessment_name": "Assignment 1",
                                                        "assessment_date": "2026-02-20",
                                                        "weight": "60.00",
                                                        "dtime": "2026-02-25 08:30:00",
                                                        "percentage": "82.50",
                                                        "mark": "33.00",
                                                        "mark_out_of": "40.00",
                                                        "captured": "1"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```

Notes on the assessment fields:

* `percentage` contains the value `"a"` when the learner was marked as absent for the assessment.
* `captured` indicates whether a mark has been captured for the assessment (`1`) or not (`0`).
* `dtime` is the date and time the mark was last updated.
* When the `structure` parameter is used, only `assessment_id`, `assessment_name`, `assessment_date` and `weight` are returned per assessment.
  {% endtab %}

{% tab title="404: Not Found The resource was not found." %}

```json
{
    "error": "Not found",
    "error_description": "No subject mark records found"
}
```

{% endtab %}

{% tab title="401: Unauthorized The server understood the request, but is refusing it or access is not allowed." %}

```json
{
    "error": "Unauthorized",
    "error_description": "Client access not authorised"
}
```

{% endtab %}

{% tab title="403: Forbidden The server understood the request, but the requested action is not allowed." %}

```json
{
    "error": "Integration not activated",
    "error_description": "Please activate the Curriculum+ API for this client before making this request"
}
```

{% endtab %}

{% tab title="400: Bad Request The server understood the request, but the request is invalid or malformed." %}

```json
{
    "error": "Bad Request",
    "error_description": "Please specify the learner_id or grade_id request parameter."
}
```

{% endtab %}
{% endtabs %}

### Examples

{% tabs %}
{% tab title="PHP" %}

```php
<?php

const BASE_URL = 'https://integrate.d6plus.co.za/api/v1/currplus/learnerassessmentmarks';
const SCHOOL_LOGIN_ID = '1000';
const PARAMS = ['learner_id' => 1];
const API_USERNAME = getenv('API_USERNAME'); // Assuming you have these environment variables set
const API_PASSWORD = getenv('API_PASSWORD');

$curl = curl_init();

$query = http_build_query(PARAMS);

$options = [
    CURLOPT_URL => BASE_URL . '/' . SCHOOL_LOGIN_ID . '?' . $query,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYPEER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => [
        "HTTP-X-USERNAME: " . API_USERNAME,
        "HTTP-X-PASSWORD: " . API_PASSWORD
    ],
];

curl_setopt_array($curl, $options);

$response = curl_exec($curl);

if (curl_errno($curl)) {
    throw new Exception('Curl error: ' . curl_error($curl));
}

curl_close($curl);

echo $response;
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --location 'https://integrate.d6plus.co.za/api/v1/currplus/learnerassessmentmarks/1000?learner_id=1' \
--header 'HTTP-X-USERNAME: your_username' \
--header 'HTTP-X-PASSWORD: your_password'
```

{% endtab %}
{% endtabs %}
