Year Groups

A year group object represents the year grouping in which students are arranged in a school.

Access: This is a read-only resource managed directly by the school.

Permissions: a school level access token with the school scope is required to access year group information. To access the students in year groups, the students scope is also required. To access the supervisors for year groups, the staff_members scope is also required.

List Year Groups

Returns a list of year groups that match the given set of filters. Year groups are returned in name order. The default behaviour is to return the year groups for the school's current academic year.

Note the If-Modified-Since header is optional (see the page on Conditional Requests for more details).

Request

GET /year_groups
Headers
Accept: application/vnd.assembly+json; version=1
Authorization: Bearer b2s7a9s8BQokikJOvBiI2HlWgH4olfQ2
If-Modified-Since: Mon, 13 Mar 2017 20:00:00 GMT
Parameter Default Example Description
year_code 10

Filter year groups by a specific NC year code.

per_page 100 25

Number of results to return on a single page. The maximum is 200.

page 1 2

page number to return

URI Template: /year_groups

Response 200

Headers
Content-Type: application/json; charset=utf-8
Last-Modified: Mon, 13 Mar 2017 20:00:00 GMT
Payload
{
    "object": "list",
    "total_count": 20,
    "total_pages": 1,
    "current_page": 1,
    "prev_page": null,
    "next_page": null,
    "data": [
        {
            "object": "year_group",
            "id": 612,
            "code": "10",
            "name": "Year Group 10",
            "start_date": "2016-09-05T00:00:00.000Z",
            "end_date": "2017-09-04T23:59:00.000Z",
            "supervisor_ids": [
                73,
                78
            ],
            "student_ids": [
                5112,
                5177,
                5137
            ]
        }
    ]
}

View a Year Group

Returns a single year group whose code matches the provided year_code. Additionally includes a list of all the student identifiers that are present in the group.

Request

GET /year_groups/{group_id}
Headers
Accept: application/vnd.assembly+json; version=1
Authorization: Bearer b2s7a9s8BQokikJOvBiI2HlWgH4olfQ2
Parameter Default Example Description
group_id 1

ID of the Year Group as an Integer

URI Template: /year_groups/{group_id}

Response 200

Headers
Content-Type: application/json; charset=utf-8
Payload
{
    "object": "year_group",
    "id": 612,
    "code": "10",
    "name": "Year Group 10",
    "start_date": "2016-09-05T00:00:00.000Z",
    "end_date": "2017-09-04T23:59:00.000Z",
    "supervisor_ids": [
        73,
        78
    ],
    "student_ids": [
        5112,
        5177,
        5137
    ]
}

List Students for Year Group

Returns a list of all the students that are present in the year group identified by year_code.

Note the If-Modified-Since header is optional (see the page on Conditional Requests for more details).

Request

GET /year_groups/{group_id}/students
Headers
Accept: application/vnd.assembly+json; version=1
Authorization: Bearer b2s7a9s8BQokikJOvBiI2HlWgH4olfQ2
If-Modified-Since: Mon, 13 Mar 2017 20:00:00 GMT
Parameter Default Example Description
group_id 1

ID of the Year Group as an Integer

per_page 100 25

number of results to return

page 1 2

page number to return

URI Template: /year_groups/{group_id}/students

Response 200

Headers
Content-Type: application/json; charset=utf-8
Last-Modified: Mon, 13 Mar 2017 20:00:00 GMT
Payload
{
   "object":"list",
   "total_count":2,
   "total_pages":1,
   "current_page":1,
   "prev_page":null,
   "next_page":null,
   "data":[
      {
         "object":"student",
         "id":15,
         "upn":"J823432114002",
         "first_name":"George",
         "middle_name":"Nathaniel",
         "last_name":"Adams",
         "dob":"2003-12-01"
      },
      {
         "object":"student",
         "id":50,
         "upn":"L820200107039",
         "first_name":"Tiger",
         "middle_name":null,
         "last_name":"Anton",
         "dob":"2004-02-09"
      }
   ]
}