Read what a template's print size is judged by
const url = 'https://api.pixonaut.app/v1/templates/example/constraints';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.pixonaut.app/v1/templates/example/constraints \ --header 'Authorization: Bearer <token>'Operation ID: templates.constraints.get
The template’s declared aspect ratio and the tolerance around it, so a consumer can check a size itself before asking POST /v1/templates/{id}/print-size. fit says how the artwork sits inside a legal box. Naming a blankId and placementId (both or neither) adds that placement’s bounds: its largest and default print box, the box a proof or design naming it and no size prints at (printWidthMm × printHeightMm, the template’s ratio fitted into the default box), and the bleed and safe area it prints with. A client draws its live preview against that box and those margins so it frames the design as the proof does. A named placement that does not resolve, or whose stored sizes are unusable, is refused with unknown_placement.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A template id, baseId@version.
A template id, baseId@version.
Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”The template’s print-size constraints
object
object
The bundled output profile whose tables draw a design on the placement on screen, or, where cmykPreviewTables is said, draw it when those cannot be read.
Where the tables a design on the placement is drawn through are read, when its print goes through an output profile the workspace uploaded and they are made: a path on the api, read with the same key.
full when a print covers the placement’s whole area: the size rule then refuses one smaller than maxWidthMm × maxHeightMm (print_size_not_area). within when it is placed inside it.
Where on the product a print may go, when not the whole rectangle: the outline, then each cut-out, in fractions of the print box, filled even-odd. A live preview clips the design to it and draws it as a guide, as the proof and the print file are cut to it.
object
True when the print shop cuts the product to this shape: the outline and the cut-outs go into the print file as its cut line. Omitted, the product already has the shape.
The shape as SVG path data in fractions of the print area, 0 to 1 across and down (curves, no arcs): its first subpath the outline, every further one a cut-out, filled even-odd, each subpath closed.
The blank’s sizes the template can and can’t print at, on a placement whose print area changes with an option (coverage full, or a position that prints one size only). Both empty on a placement whose area doesn’t, which the template fits at every size.
object
The sizes the template prints at here, by option value, such as S; several options’ values are joined with /.
The sizes the template can’t print at here: a design at one is refused when committed.
object
The ratio’s height part. Positive.
The ratio’s width part. Positive.
Examples
Example
{ "fit": "contain", "placement": { "blankId": "blank_tshirt", "bleedMm": 3, "cmykPreviewProfile": "ISOcoated_v2_eci", "coverage": "within", "defaultHeightMm": 360, "defaultWidthMm": 300, "maxHeightMm": 420, "maxWidthMm": 330, "placementId": "front", "printHeightMm": 360, "printWidthMm": 280, "safeAreaMm": 5, "sizes": { "fits": [], "misfits": [] } }, "ratio": { "h": 360, "w": 280 }, "ratioTolerance": 0, "templateId": "tshirt-basic@2"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: unauthorized
object
Examples
unauthorized
{ "error": "unauthorized"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: origin_forbidden, feature_disabled, forbidden, workspace_suspended
object
The feature the tenant does not have. Always sent with feature_disabled.
Examples
feature_disabled
{ "error": "feature_disabled", "feature": "api"}forbidden
{ "error": "forbidden"}origin_forbidden
{ "error": "origin_forbidden"}workspace_suspended
{ "error": "workspace_suspended"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: not_found
object
Examples
not_found
{ "error": "not_found"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: invalid_query, unknown_placement
object
Examples
invalid_query
{ "error": "invalid_query"}unknown_placement
{ "error": "unknown_placement"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: rate_limited
object
Examples
rate_limited
{ "error": "rate_limited"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: db_error. A request that failed unexpectedly answers as text instead.
object
Examples
db_error
{ "error": "db_error"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: print_box_unavailable
object
Examples
print_box_unavailable
{ "error": "print_box_unavailable"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Questions? Write to [email protected].