Metrics
Track behavioral metrics (psychomotor and affective) for students. Download and upload metric sheets.
All endpoints require
Authorization: Bearer <token>andX-SCHOOL-IDheaders.
Get Batch Metrics
GET /metrics
Retrieve metrics for all students in a cohort batch.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
batchId | uuid | Yes | Cohort batch ID |
Example
curl -X GET "https://api.vanillatots.com/metrics?batchId=batch-uuid" \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID"
Response 200 OK
[
{
"id": "uuid",
"student_name": "John Doe",
"admission_number": "STU-001",
"term": "First Term 2024",
"batch": "batch-uuid",
"metric_type": "PSYCHOMOTOR",
"metric_scores": {
"handwriting": 4,
"drawing": 3,
"sports": 5
}
}
]
Metric Types: PSYCHOMOTOR | AFFECTIVE
Download Metric Sheet
GET /metrics/download-sheet
Download a metric sheet template as an Excel file.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
batchId | uuid | Yes | Cohort batch ID |
term | string | Yes | Term identifier |
metric_type | string | Yes | PSYCHOMOTOR or AFFECTIVE |
Example
curl -X GET "https://api.vanillatots.com/metrics/download-sheet?batchId=uuid&term=first&metric_type=PSYCHOMOTOR" \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID" \
-o metrics.xlsx
Response 200 OK — Returns binary file content (application/octet-stream).
Upload Metric Sheet
POST /metrics/upload-sheet
Upload a completed metric sheet for processing.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
batchId | integer | Yes | Batch ID |
Request Body — multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
metric_sheet | binary | Yes | Excel file with metric scores |
Example
curl -X POST "https://api.vanillatots.com/metrics/upload-sheet?batchId=123" \
-H "Authorization: Bearer $TOKEN" \
-H "X-SCHOOL-ID: $SCHOOL_ID" \
-F "metric_sheet=@/path/to/metrics.xlsx"
Response 200 OK