Skip to content
ToolsOnDuty - free online tools
ToolsOnDuty / docs
Browse documentation

Reference / Education

Education API

3 endpoints for education workflows. Every call requires bearer authentication and uses the standard ToolsOnDuty response envelope.

Try it

Runs a real request from your browser to your own ToolsOnDuty account. Your key is only kept in this page and is never stored.

POST/v1/education/grade1 credit / call

Percentage to grade

Convert a percentage to a letter grade using a default (or custom) grade band table.

ParameterTypeRequiredDescription
percentagenumberYesPercentage, 0-100.
bandsstringNoOptional array of {grade, min} objects, sorted by min descending.

Request

curl -X POST https://toolsonduty.com/api/v1/education/grade \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"percentage":87}'

Response

{
  "ok": true,
  "data": {
    "grade": "A2"
  }
}
POST/v1/education/attendance-summary1 credit / call

Attendance summary

Summarize a list of daily attendance codes (P=present, A=absent, L=leave) into counts and a percentage.

ParameterTypeRequiredDescription
codesstringYesArray of codes: "P", "A", "L" or "" (unmarked).

Request

curl -X POST https://toolsonduty.com/api/v1/education/attendance-summary \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"codes":["P","P","A","L","P"]}'

Response

{
  "ok": true,
  "data": {
    "present": 3,
    "absent": 1,
    "leave": 1,
    "percentage": 60
  }
}
POST/v1/education/result-analysis1 credit / call

Student result analysis

Compute a student's total marks, percentage, pass/fail and grade across a list of subjects.

ParameterTypeRequiredDescription
marksstringYesObject mapping subject id to marks obtained, e.g. {"math": 85}.
subjectsstringYesArray of {id, name, maximum, pass} subject definitions.

Request

curl -X POST https://toolsonduty.com/api/v1/education/result-analysis \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"marks":{"math":85,"science":78},"subjects":[{"id":"math","name":"Math","maximum":100,"pass":33},{"id":"science","name":"Science","maximum":100,"pass":33}]}'

Response

{
  "ok": true,
  "data": {
    "obtained": 163,
    "maximum": 200,
    "percentage": 81.5,
    "passed": true,
    "grade": "A2"
  }
}