Skip to content

Check a print size against a template

POST
/v1/templates/{id}/print-size
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.

id
required

A template id, baseId@version.

string

A template id, baseId@version.

Media typeapplication/json
Any of:
object
blankId
string
>= 1 characters
heightMm
required
number
> 0
placementId
string
>= 1 characters
widthMm
required
number
> 0

Examples

Exampleexample

Example

{
"blankId": "blank_tshirt",
"heightMm": 360,
"placementId": "front",
"widthMm": 280
}

The verdict, or one per size in the order asked

Media typeapplication/json
Any of:
object
legal
required
boolean

Examples

Exampleexample

Example

{
"legal": true
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplebad_json

bad_json

{
"error": "bad_json"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplenot_found

not_found

{
"error": "not_found"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
bytes

Sent with payload_too_large.

number
error
required
string
maxBytes

Always sent with payload_too_large.

number
reason

Always sent with invalid_body.

string

Examples

invalid_body

{
"error": "invalid_body",
"reason": "string"
}
X-Request-Id
required
string

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

Media typeapplication/json
object
error
required
string

Examples

Examplerate_limited

rate_limited

{
"error": "rate_limited"
}
X-Request-Id
required
string

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
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

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].

Status · Terms of service · Privacy policy · Subprocessors