uploadId. The file goes straight to the address as raw bytes, with no base64 and no JSON around it.
Upload and parse a file
Get an API key in the Quickstart. An upload needs an API key. This flow has three steps: get the address,PUT the file to it, and parse. The file is a small two-page PDF named report.pdf.
Read the response
The first call answers with the address to send the file to.uploadUrl is cut here, because it is a one-time address that you should not share.
uploadRef is the same value as uploadId. The PUT answers with an empty 200. The parse call answers like any other parse call. With pages set to true, it also returns each page.
uploadId parses once. Parsing the same uploadId again returns 404 notFound.
Options
POST /v1/parse/upload-url takes these fields.
POST /v1/parse takes uploadRef in place of file. Every other field works the same. See Parse documents and Formats.
Limits and errors
- A file can be up to 36 MB (37,748,736 bytes).
- Send the file to
uploadUrlwithin 15 minutes of the call. After that, the address stops working. - Parse the file within 1 hour of getting the address. After that, the id stops working and parse returns
404 notFoundwithNo upload with that id. An upload id works for one hour. - Parse before the
PUTreturns400 invalidRequestwithThat file was not uploaded yet. PUT it to uploadUrl first. - A file over 36 MB returns
400 invalidRequestwithThis file is larger than 36 MB. Send a file of up to 36 MB.and the upload is deleted. - A parse that sends
uploadRefwithout an API key returns400 invalidRequestwithAn upload needs an API key. - Getting the address is free. The parse costs what any parse costs, and a failed parse costs nothing.
Related
- Parse documents sends a file of up to 36 MB inside the JSON body.
- Formats lists the file types and the PDF options.
- PDFs and documents reads a file by its address.
- Zero data retention keeps nothing from a parse.