ClassCharts API Docs

List Detentions

Gets the student's detentions

GET
/detentions/{studentId}
/detentions/{studentId}

The Authorization access token

Authorization

Authorization
Required
Basic <token>

This is the session_id returned when logging in. e.g. Basic eW91IHNob3VsZCBzdGFyIHRoaXMgcmVwbyE=

In: header

Path Parameters

studentId
Required
integer

curl -X GET "https://www.classcharts.com/apiv2student/detentions/0" \
  -H "Authorization: Basic <token>"

Array of detentions

{
  "data": [
    {
      "id": 0,
      "attended": "yes",
      "date": "string",
      "length": 0,
      "location": "string",
      "notes": "string",
      "time": "string",
      "pupil": {
        "id": 0,
        "first_name": "string",
        "last_name": "string",
        "school": {
          "opt_notes_names": "string",
          "opt_notes_comments": "string",
          "opt_notes_comments_pupils": "string"
        }
      },
      "lesson": {
        "id": 0,
        "name": "string",
        "subject": {
          "id": 0,
          "name": "string"
        }
      },
      "lesson_pupil_behaviour": {
        "reason": "string"
      },
      "teacher": {
        "id": 0,
        "first_name": "string",
        "last_name": "string",
        "title": "string"
      },
      "detention_type": {
        "name": "string"
      }
    }
  ],
  "meta": {
    "detention_alias_plural": "string"
  },
  "success": 0
}