contentType pdf_uri, or embed the file with pdf_base64. PrintEasy stores the job, delivers it to the agent and reports every state change.
POST /v1/printjobs. The response is 201 with the job object in state queued.
URL or base64
Both forms accept files up to 25 MB.pdf_base64: the file as standard base64 text, decoded size at most 25 MB. The bytes must start with%PDF-, otherwise the API answers422 invalid_content. A body that is too large answers413 content_too_large.pdf_uri: anhttporhttpsURL of at most 2048 characters. PrintEasy fetches it once, with a 30 second timeout, and keeps the file for the job. Redirects are not followed, private and reserved addresses are refused, and only ports 80 and 443 are allowed. A URL that fails these checks at creation answers422 invalid_content_url. The fetch itself happens right after the job is created, so a URL that cannot be fetched later (an error status, a timeout, a file that is too large) ends the job inerror, with the reason instateMessage. Use a signed URL that stays valid for a few minutes.
authentication:
422 printer_disabled, and a key of the wrong mode answers 422 mode_mismatch (see Test mode).
Job states
Each job moves forward through these states. Every change is recorded as an event you can read withGET /v1/printjobs/{id}/events and receive as a webhook.
A job in
sent that is not acknowledged within 60 seconds is sent again, up to 3 times, then returns to queued. A job in printing that is not reported done within 15 minutes becomes error with the message spooler timeout. done means the spooler finished the job; a printer can still be out of paper.
stateMessage also carries warnings about options the printer ignored.
Waiting for completion
The simplest option is the SDK, which creates the job and polls until it reaches a final state (done, error, cancelled or expired).
printjob.done and printjob.error with webhooks instead of holding a request open. You can also read GET /v1/printjobs/{id} at any time.
Cancelling
POST /v1/printjobs/{id}/cancel cancels a job while it is queued or sent. It needs a key with the print scope, and dashboard users with the member role get 403. Once the agent has received the job it can no longer be cancelled, and the API answers 409 not_cancellable.
Reprinting
A job that ended inerror is not retried automatically. To print an earlier job again without sending the document again, call POST /v1/printjobs with printerId, title and reprintOf (the id of the earlier job) instead of contentType and content. PrintEasy copies the stored file; send exactly one of the two forms, otherwise the API answers 400 invalid_request.
410 file_expired and you need to send the document again with contentType and content. Use a new Idempotency-Key for each new attempt, because the same key returns the first job (see Rate limits and idempotency).