Skip to main content

Metrics

Track behavioral metrics (psychomotor and affective) for students. Download and upload metric sheets.

All endpoints require Authorization: Bearer <token> and X-SCHOOL-ID headers.


Get Batch Metrics

GET /metrics

Retrieve metrics for all students in a cohort batch.

Query Parameters

ParameterTypeRequiredDescription
batchIduuidYesCohort 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

ParameterTypeRequiredDescription
batchIduuidYesCohort batch ID
termstringYesTerm identifier
metric_typestringYesPSYCHOMOTOR 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

ParameterTypeRequiredDescription
batchIdintegerYesBatch ID

Request Bodymultipart/form-data

FieldTypeRequiredDescription
metric_sheetbinaryYesExcel 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