Quickstart
This walks through one paper and one student in test mode with curl. Replace the IDs with the ones your responses return.
export AIDE_API_KEY="aide_sk_test_..." # your test key1. Create an upload for the question paper, then send the bytes to the URL it returns. Repeat for the marking scheme with "purpose": "marking_scheme".
curl https://api.learningaide.ai/v1/files \ -H "Authorization: Bearer $AIDE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "purpose": "question_paper", "filename": "physics-paper-2.pdf", "content_type": "application/pdf", "size_bytes": 2483021 }'curl -X PUT "<upload.url from the response>" \ -H "Content-Type: application/pdf" \ --data-binary @physics-paper-2.pdf2. Find the subject, then create the paper.
curl "https://api.learningaide.ai/v1/subjects?query=physics" \ -H "Authorization: Bearer $AIDE_API_KEY"curl https://api.learningaide.ai/v1/papers \ -H "Authorization: Bearer $AIDE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 0b6d1f0e-3b5c-4a52-9a0e-6d2b7f1c9e41" \ -d '{ "title": "Physics Paper 2 - Mock exam", "subject_id": "subj_8Hn2Qx5Lw1", "question_paper": { "file_id": "file_Qp4Ys8Lm1R" }, "marking_scheme": { "file_id": "file_Ms7Tg3Kd9P" } }'The paper starts as processing. Wait for the paper.awaiting_review webhook, or poll GET /v1/papers/{id}.
3. Check the questions, then approve the paper. You can send your reviewer a review link instead.
curl https://api.learningaide.ai/v1/papers/pap_3fT9qLx2Wd/questions \ -H "Authorization: Bearer $AIDE_API_KEY"
curl -X POST https://api.learningaide.ai/v1/papers/pap_3fT9qLx2Wd/approve \ -H "Authorization: Bearer $AIDE_API_KEY"4. Upload a student’s script the same way as step 1, with "purpose": "answer_script".
5. Create a submission.
curl https://api.learningaide.ai/v1/submissions \ -H "Authorization: Bearer $AIDE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 7c9e2a44-1d0b-4f8e-b3a6-52e9d0c4f7a8" \ -d '{ "paper_id": "pap_3fT9qLx2Wd", "student": { "external_id": "STU-0042", "name": "Ayesha K." }, "files": [ { "file_id": "file_As2Vb6Nc8T" } ] }'6. When submission.released arrives, fetch the result and the report.
curl https://api.learningaide.ai/v1/submissions/sub_7Hk2Pz9QaN/result \ -H "Authorization: Bearer $AIDE_API_KEY"
curl https://api.learningaide.ai/v1/submissions/sub_7Hk2Pz9QaN/report \ -H "Authorization: Bearer $AIDE_API_KEY"