Developer guides

Build against the wire contract.

These guides use public raw HTTP requests to https://api.printhook.io. Begin with one print, then add safe retries, typed error handling, terminal-state tracking, and signed webhooks.

Choose a guide

Quickstart: send your first print job

Authenticate with GET /v1/me, discover an online printer, create a PDF job, and poll the returned job until terminal is true. Includes runnable cURL, JavaScript fetch, Python requests, PHP cURL, C# HttpClient, and Odoo raw HTTP examples.

Reliable jobs: retries, polling, and typed errors

Choose a stable Idempotency-Key, distinguish uncertain outcomes from refusals, respect Retry-After, and branch on error.class and error.code instead of message text.

Webhooks: receive and verify events

Create a subscription, preserve the raw request body, verify the HMAC-SHA256 signature in constant time, reject stale deliveries, and deduplicate at-least-once events.

Postman downloads

Use a current Postman version with pm.execution.skipRequest() support. Import the Postman collection and either the environment for this site or the blank custom environment. These templates contain no credentials. Inspect the API origin before entering a key; use a trusted HTTPS origin. Fill the secret api_key as a private local value, never a shared value. Do not sync or export populated secrets, signed document URLs, or response history. A masked field alone is not a secret vault.

  1. In Postman Settings, set the request timeout to 20000 ms, disable automatically following redirects, and keep TLS certificate verification enabled.
  2. Send identity, limits, and printer discovery requests individually. Select and set printer_id yourself; discovery does not automatically choose a printer. Follow collection cursors manually when needed.
  3. Set an immutable reachable document_url and a stable idempotency_key. Save that exact request and original attempt time. Only after reviewing the real printer, set allow_mutations to true. Creating a job sends a real print; creating a webhook adds a real subscription. Reset the flag to false afterward.
  4. The create response captures job_id. Read it with the single-poll request until terminal is true; stop after two minutes and reconcile later rather than making a new print. There are no runner loops or automatic retries. Follow the reliability guide before replaying an uncertain create.
  5. For webhook creation, save the once-returned secret directly into your receiver's secret manager. The collection captures only the subscription id, never its secret. The response itself is sensitive; do not share it.

Use these as manual learning requests, not a production worker or an unattended collection run. Fixture tests for the guide examples simulate HTTP responses locally; they do not prove a real API connection, actual spooler acceptance, or physical printing.

Reference

The guides cover the normal integration path. Use the API overview for conventions and the OpenAPI 3.1 document for every public operation and schema.

Start with one durable job.