Print farm quickstart

View as Markdown

The print farm API lets a production partner read the orders allocated to its farm, report their progress, and read the products, stocks and materials it produces.

The print farm API keeps the conventions it was built with: numbered pages instead of cursors, and its own error body. Its ids and field names are its own too, so the conventions in the designer and integrator guides do not apply here.

The base URL

Every path starts with /v1/print-farm. The examples read the API base URL from DAPI_API_URL and your key from DAPI_API_KEY.

Shell
export DAPI_API_URL="<the API base URL>"
export DAPI_API_KEY="<your API key>"

All requests and responses are JSON over HTTPS.

API keys and permissions

Make your first request

List your orders returns the orders allocated to your farm, newest first. It is the quickest way to check that a key works.

GET/v1/print-farm/orders
curl "https://public-api.dapi.digital/v1/print-farm/orders" \
  -H "x-api-key: $DAPI_API_KEY"

Pages

Lists are numbered pages. Ask for one with these query parameters:

  • pageinteger

    1-based page index.

    Range at least 1. Defaults to 1.
  • page_sizeinteger

    Page size (max 100).

    Range 1 to 100. Defaults to 20.

Next to the items, a list response says where you are:

  • pagenumber

    Page number returned, matching the page query parameter.

    Range at least 1.
  • page_sizenumber

    Number of items per page, matching the page_size query parameter.

    Range 1 to 100.
  • totalnumber

    Total number of orders across all pages (after filters are applied).

    Range at least 0.

Errors

Errors have the body { "statusCode", "error", "message" }. message is a string, or a list of strings when the request failed validation.

Error
{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid or inactive API key."
}

Rate limits

Requests are limited to 500 per 60-second window per API key. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.