Replace an attendance sheet: Migration guide

This guide details how the Replace an attendance sheet endpoint has changed (previously known as PATCH updateClassroomSlotAttendance in v1).

💡

Key changes

  • HTTP method: The v2 endpoint uses the PUT method, while v1 used the PATCH method.
  • Attendance managament: The operation shifted from managing individual user attendance records to managing the properties of the attendance sheet as a whole.
    • v1's updateClassroomSlotAttendance endpoint allowed direct modification of individual users' attendance statuses within a classroom slot.
    • v2's Replace an attendance sheet endpoint, conversely, focuses on replacing the name of an attendance sheet and does not directly support updating individual user attendance records through its request body.

Documentation links

Here are the links to the API reference for:

Endpoint mapping

Here's the direct correlation between the v1 and v2 endpoint URLs:

  • API v1: classrooms/slots/:classroomSlotId/attendance
  • API v2: classroom-slots/{classroomSlotId}/attendance-sheets/{attendanceSheetId}

Input changes

This section details the specific alterations to the input requirements between API versions.

API v1 input example

curl --location -g --request PATCH 'https://app.360learning.com/api/v1/classrooms/slots/1a2b3c4d5e6f7a8b9c8d7e6f/attendance?company={{company_id}}&apiKey={{api_key}}' \
--header 'Content-Type: application/json' \
--data '{
    "users": [
        {
            "userId": "5d19c86b73ae6c17981e80bd",
            "hasAttended": true
        },
        {
            "userId": "5d5ac6b32bcf8103d4cb07e3",
            "hasAttended": false
        }
    ]
}'

API v2 input example

curl --request PUT \
     --url https://app.360learning.com/api/v2/classroom-slots/507f1f77bcf86cd799439011/attendance-sheets/507f1f77bcf86cd799439011 \
     --header '360-api-version: v2.0' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer access_token' \
     --header 'content-type: application/json' \
     --data '
{
  "name": "First day afternoon"
}
'

Main input differences

Change typeAPI v1API v2
Removed
Body parameter
users (Required): Array of objects, each containing userId and hasAttended. Removed from API v2, not replaced.-
Added
Path parameter
-attendanceSheetId (Required): The unique ID of the attendance sheet.
Added
Body parameter
-name (Required): The title of the attendance sheet.

Output changes

This section details the specific alterations to the successful output returned between API versions.

API v1 output example

{
  "message": "X user(s) updated"
}

API v2 output example

{
  "_id": "507f1f77bcf86cd799439011",
  "name": "First day afternoon",
  "personalizedFields": {
    "organizationName": "360Learning",
    "organizationLogoId": "507f1f77bcf86cd799439011"
  },
  "status": "closed",
  "checkInCode": "1234"
}

Main output differences

API v2 provides a detailed JSON object representing the updated attendance sheet, including its ID, name, personalized fields, status, and check-in code, unlike v1, which returned a simple success message.

Change typeAPI v1API v2
Removed
Output property
message: A string indicating the number of users updated.-
Modified
Success output
200 with a simple plain text message.200 with a detailed JSON object representing the updated attendance sheet.
Added
Output property
-_id(Required): Unique ID of the attendance sheet.
Added
Output property
-name(Required): Title of the attendance sheet.
Added
Output property
-personalizedFieldsObject for customization options, including organizationName and organizationLogoId.
Added
Output property
-status(Required): Current status of the attendance sheet (closed, signed, adjustment, open).
Added
Output property
-checkInCodeCode used by learners to check in (required if status is open).