Exam Room Allocation (VN) API
Allocate candidates to exam rooms: candidate numbers in Vietnamese alphabetical order by given name, seats, mixed classes, posted lists as XLSX.
Send the candidate list as students (JSON array, CSV text or an uploaded CSV / XLSX file; Vietnamese headers such as ho_ten, lop, ngay_sinh are recognised) and the rooms (rooms as a number or [{ name, capacity }], or just capacity, default 24). Candidates are ordered like Vietnamese class lists – by given name, then family and middle names, with the Vietnamese collation of /v1/vn-sort (An < Anh < Ánh < Bình, đ after d) – or by order=class, random (reproducible with seed) or given.
Candidate numbers (sbd_prefix, sbd_start, sbd_digits) follow that order; rooms are filled to capacity (fill=sequential) or evenly (balanced), and interleave_classes=true seats neighbours from different classes. Extra columns (subject, exam code…) are kept on each candidate.
format=xlsx gives the master list plus one sheet per room to post on the door and use as the signature sheet (sheets, exam code, signature, invigilators). Nothing is stored.
Markdown · OpenAPI · Postman · llms.txt
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
students | body | array | yes | Candidates: JSON [{ ho_ten, lop, ngay_sinh, … }], CSV text, or file (CSV / XLSX). | |
file | body | file | no | CSV or XLSX list (multipart). | |
rooms | body | array | no | Number of rooms or [{ name, capacity }]. | |
capacity | body | number | no | 24 | Seats per room. |
order | body | string | no | name | name, class, random (+ seed) or given. |
sbd_prefix | body | string | no | Candidate-number prefix; sbd_start (1), sbd_digits. | |
fill | body | string | no | sequential | sequential or balanced; interleave_classes=true to mix classes. |
format | body | string | no | json | json or xlsx (with exam, school). |
Example
curl -X POST "https://apibox.io.vn/v1/vn-exam-rooms" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"students":[{"ho_ten":"Nguyễn Văn Bình","lop":"9A"},{"ho_ten":"Trần Thị An","lop":"9B"},{"ho_ten":"Lê Văn Đức","lop":"9A"}],"capacity":2,"sbd_prefix":"HK1-"}'const res = await fetch('https://apibox.io.vn/v1/vn-exam-rooms', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"students": [
{
"ho_ten": "Nguyễn Văn Bình",
"lop": "9A"
},
{
"ho_ten": "Trần Thị An",
"lop": "9B"
},
{
"ho_ten": "Lê Văn Đức",
"lop": "9A"
}
],
"capacity": 2,
"sbd_prefix": "HK1-"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/vn-exam-rooms",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"students": [{"ho_ten": "Nguyễn Văn Bình", "lop": "9A"}, {"ho_ten": "Trần Thị An", "lop": "9B"}, {"ho_ten": "Lê Văn Đức", "lop": "9A"}], "capacity": 2, "sbd_prefix": "HK1-"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/vn-exam-rooms');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"students":[{"ho_ten":"Nguyễn Văn Bình","lop":"9A"},{"ho_ten":"Trần Thị An","lop":"9B"},{"ho_ten":"Lê Văn Đức","lop":"9A"}],"capacity":2,"sbd_prefix":"HK1-"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"count": 3,
"rooms": [
{
"room": "Phòng 01",
"capacity": 2,
"candidates": 2,
"sbd_from": "HK1-001",
"sbd_to": "HK1-002"
},
{
"room": "Phòng 02",
"capacity": 2,
"candidates": 1,
"sbd_from": "HK1-003",
"sbd_to": "HK1-003"
}
],
"order": "name",
"fill": "sequential",
"interleave_classes": false,
"candidates": [
{
"sbd": "HK1-001",
"name": "Trần Thị An",
"class": "9B",
"dob": null,
"room": "Phòng 01",
"seat": 1
},
{
"sbd": "HK1-002",
"name": "Nguyễn Văn Bình",
"class": "9A",
"dob": null,
"room": "Phòng 01",
"seat": 2
},
{
"sbd": "HK1-003",
"name": "Lê Văn Đức",
"class": "9A",
"dob": null,
"room": "Phòng 02",
"seat": 1
}
],
"privacy": "Nothing you send is stored."
}
Use cases
- Prepare rooms and candidate numbers for the term exams
- Run internal company tests with mixed departments per room
- Generate the door lists and signature sheets as Excel
- Number candidates of a mock exam at a tutoring centre
FAQ
How are Vietnamese names sorted?
By given name first (the last word), then family and middle names, letter by letter in the Vietnamese alphabet with tone order ngang, huyền, hỏi, ngã, sắc, nặng.
Can I keep the same random order next time?
Yes: order=random with the same seed always gives the same order.
Is there a PDF admission card?
Not yet: use the XLSX sheets, or fill a card template with /v1/docx-template.
Related APIs
JSON Validator
Check JSON syntax with exact line and column of errors, and validate data against a JSON Schema (draft 4, 7, 2019-09 or 2020-12).
{ }JSON Formatter
Pretty print JSON with 0-8 spaces or tabs, minify it, or sort object keys recursively. Syntax errors are reported with line and column.
CSVCSV to JSON
Convert CSV into an array of JSON objects using the header row, with delimiter auto-detection, number and boolean typing, and row-level errors.