DataShift Logo

DataShift Direct Print API · v0.3.0

API Reference

Push print jobs directly to your registered Datashift print devices.

Base URL: https://datashift.com.au/api/direct-printAuth: Authorization: Bearer dsdp_<64-hex-chars>

Devices

get/deviceslistDevices

List print devices

Returns active (non-revoked) print devices registered for the tenant, each with its full list of reported printers. Use the `id` of the desired device as `deviceId` when calling `POST /print-jobs`. Optionally use one of that device's `printers[].id` as `printerId` to override which physical printer on the device receives the job — omit it to use the device's preferred printer (the one with `isPreferred: true`). Devices are registered from the Datashift portal (Settings → print devices). Each device runs the Datashift print-client software and listens for print jobs over Pub/Sub. Revoked devices are excluded from this list. A device that hasn't reported its printer list yet (older print-client versions) has an empty `printers` array. Requires the `devices:read` scope.

Responses

200Active print devices for this tenant
DeviceListResponse
401Missing or invalid API key
Error
403The API key is valid and active, but lacks the scope required for this operation
ForbiddenError
429Too many requests for this API key — see Retry-After header
RateLimitError

Schemas

Error

{
  message: string
  code?: string
}

ForbiddenError

{
  success: false
  error: string
  code?: string
}

RateLimitError

{
  error: string
  code: RATE_LIMIT_EXCEEDED
  retryAfter: integer  // Seconds until the rate limit resets
}

Device

{
  id: string  // Use as `deviceId` in print-job requests
  label: string  // Human-readable name for the device (set during registration)
  printerName?: string,null  // Deprecated — the device's preferred printer name, kept for backward compatibility. Prefer `printers[]`.
  lastUsedAt?: string,null  // When this device last received a print job
  createdAt: string
  printers: Printer[]  // Every printer this device has reported. Empty for a device running a pre-multi-printer print-client version.
}

Printer

{
  id: string  // Use as `printerId` in print-job requests to override the device's preferred printer
  name: string  // OS printer name as reported by the print client
  isPreferred: boolean  // Whether this is the printer the device currently defaults to when no `printerId` override is given
  isOnline?: boolean,null  // Best-effort online status as of the last device sync — may be stale
  lastSeenAt?: string  // When the device last reported this printer
}

DeviceListResponse

{
  devices: Device[]
}

PrintJobRequest

{
  deviceId: string  // ID of the print device to send the job to (from `GET /devices`)
  pdfBase64: string  // Base64-encoded PDF document to print. Maximum 9,000,000 base64 characters (~6.75 MB of raw PDF).
  printerId?: string  // Optional id of a specific printer on the target device; defaults to the device's preferred printer when omitted.
}

PrintJobCreated

{
  jobId: string  // Direct Print job ID
  status: DELIVERED  // Always DELIVERED on a 201 — means handed to the delivery queue, not confirmed printed
}