Check a print size against a template
const url = 'https://api.pixonaut.app/v1/templates/example/print-size';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"blankId":"blank_tshirt","heightMm":360,"placementId":"front","widthMm":280}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pixonaut.app/v1/templates/example/print-size \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "blankId": "blank_tshirt", "heightMm": 360, "placementId": "front", "widthMm": 280 }'Operation ID: templates.printSize.validate
Judges widthMm × heightMm against the template’s declared ratio and, when the body names a blankId and placementId (both or neither), against that placement’s maximum print area. An illegal size is still a 200: the verdict says which check it failed. A body with sizes (up to 50) in place of one size judges each against the same placement, answering verdicts in the order asked. A named placement that does not resolve is refused with unknown_placement rather than judged without its bounds.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A template id, baseId@version.
A template id, baseId@version.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
Examples
Example
{ "blankId": "blank_tshirt", "heightMm": 360, "placementId": "front", "widthMm": 280}Responses
Section titled “Responses”The verdict, or one per size in the order asked
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: bad_json
object
Examples
bad_json
{ "error": "bad_json"}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: forbidden, origin_forbidden, feature_disabled, 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_body, unknown_placement, payload_too_large
object
Sent with payload_too_large.
Always sent with payload_too_large.
Always sent with invalid_body.
Examples
invalid_body
{ "error": "invalid_body", "reason": "string"}payload_too_large
{ "error": "payload_too_large", "maxBytes": 0}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.
Questions? Write to [email protected].