Upload an exam question paper
Attach question paper files to an exam, then submit them so the AI can extract the questions and marks.
isFinal to submit.Rules
- Send exactly one of
documents,fileUrl, orisFinalper request. - Files must be
.pdf,.jpg,.jpeg, or.png, and at most 20 MB each. - Declare each file’s type in its multipart part:
application/pdf,image/jpeg, orimage/png. The API reads the part’sContent-Type, not the file name. Most other values are rejected with400 Invalid file type, but the Word.docxtype is not, so do not send one by accident. - A PDF can have at most 50 pages, and an exam takes one PDF. You cannot mix a PDF with images.
- Images can arrive across several calls. Each call adds to what is already there.
fileUrlreplaces an upload: a public HTTPS link that the API fetches itself. It rejects the link unless the file starts with%PDF, and allows onefileUrlper exam. A link that is not a usable URL returnsInvalid URL, alocalhostor private network address returnsPrivate or local URLs are not allowed, a link that answers with anything other than200or206returnsURL returned status <n>, and a link that cannot be reached at all returnsURL is not reachable.- Send
{"isFinal": true}only after every file is uploaded. That starts question extraction and moves the exam tostatus1In Progress.
Reading the response
Next step
Get extracted exam questions
Authorizations
Access token from Get an access token. A missing, invalid, or expired token returns 403.
Path Parameters
The exam id returned by Create an exam.
"d19e6868-98dd-4274-a2a5-4a616dd93ea7"
Body
Question paper files. One .pdf of up to 50 pages, or any number of .jpg and .png images. Up to 20 MB per file. Each part's Content-Type decides the file type, so declare application/pdf, image/jpeg, or image/png. You cannot mix a PDF with images, and only one PDF is allowed per exam.
Public HTTPS link to a PDF, instead of uploading one. The API fetches the link and rejects it unless the body starts with %PDF. One fileUrl per exam, and never alongside uploaded files.
"https://example.com/papers/science-set-a.pdf"
Send true to submit the uploaded files for question extraction. Send it on its own.
Correct the grade code.
Correct the subject. A name, with the same rules as in Create an exam.
Correct the kind of exam. A name, with the same rules as in Create an exam.
Correct the paper set label.
Correct the exam date.
Correct the class section. Accepted, but this endpoint does not save it.
Response
The exam was updated. With isFinal=true, extraction has started and the exam's status is now 1 In Progress.