Attendance

Attendance statuses are assigned to users for a specific date through enrollments.

Fields

FieldNameDescriptionTypeRequired
enrollment_id Enrollment ID The ID of the enrollment for which you are assigning an attendance status integer yes
date Date The date for which the status is being set date (YYYY-MM-DD) yes
status Status The attendance status:
  • 1: present
  • 2: absent
  • 3: late
  • 4: excused
{1-4} yes
comment Comment A comment to associate with this attendance status string

Operations

list

View a list of attendance statuses (paged). The following query strings can (optionally) be appended to the path to filter results:

  • start and end: filter statuses for a given date range, inclusive (YYYY-MM-DD)
  • enrollment_id: filter statuses for a given enrollment

Retrieving this list without specifying the above parameters will return a paged list of all statuses for all dates and students in the course section.

Path

GET https://api.schoology.com/v1/sections/{section_id}/attendance

Content

none

Return

A collection of attendance status objects, each one containing attendance fields

JSON
{
    "date": [
        {
            "date": "2014-01-13",
            "statuses": {
                "status": [
                    {
                        "status_code": 2,
                        "attendances": {
                            "attendance": [
                                {
                                    "enrollment_id": 44783151,
                                    "date": "2014-01-13",
                                    "status": 2,
                                    "comment": ""
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "date": "2014-01-14",
            "statuses": {
                "status": [
                    {
                        "status_code": 3,
                        "attendances": {
                            "attendance": [
                                {
                                    "enrollment_id": 44783151,
                                    "date": "2014-01-14",
                                    "status": 3,
                                    "comment": ""
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ],
    "totals": {
        "total": [
            {
                "status": 2,
                "count": 1
            },
            {
                "status": 3,
                "count": 1
            }
        ]
    }
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <date>
        <date>2014-01-13</date>
        <statuses>
            <status>
                <status_code>2</status_code>
                <attendances>
                    <attendance>
                        <enrollment_id>44783151</enrollment_id>
                        <date>2014-01-13</date>
                        <status>2</status>
                        <comment />
                    </attendance>
                </attendances>
            </status>
        </statuses>
    </date>
    <date>
        <date>2014-01-14</date>
        <statuses>
            <status>
                <status_code>3</status_code>
                <attendances>
                    <attendance>
                        <enrollment_id>44783151</enrollment_id>
                        <date>2014-01-14</date>
                        <status>3</status>
                        <comment />
                    </attendance>
                </attendances>
            </status>
        </statuses>
    </date>
    <totals>
        <total>
            <status>2</status>
            <count>1</count>
        </total>
        <total>
            <status>3</status>
            <count>1</count>
        </total>
    </totals>
</result>

update

Modify attendance statuses

Path

PUT https://api.schoology.com/v1/sections/{section_id}/attendance

Content

Objects containing attendance fields

JSON
{
  "attendances": {
    "attendance": [
      {
        "enrollment_id": "784754",
        "date": "2014-05-20",
        "status": "1"
      }
    ]
  }
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
	<attendances>
		<attendance>
			<enrollment_id>784754</enrollment_id>
			<date>2014-05-20</date>
			<status>1</status>
		</attendance>
	</attendances>
</result>
Return

An array of attendance ids and statuses

JSON
{
  "attendance": [
    {
      "id": "564027",
      "response_code": 200
    }
  ]
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
	<attendance>
		<id>564027</id>
		<response_code>200</response_code>
	</attendance>
</result>