Correct a design that has not been ordered
const url = 'https://api.pixonaut.app/v1/designs/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"expectedRevision":1,"values":{"namn":{"content":"Merry Christmas"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.pixonaut.app/v1/designs/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "expectedRevision": 1, "values": { "namn": { "content": "Merry Christmas" } } }'Operation ID: designs.update
Applies values on top of the design’s document under the rules its template version sets, keeps the size it was committed at, and sends it back to awaiting approval: any approval, made or scheduled, is cleared, and nothing is printed or ordered until it is approved again. Renders a proof of the corrected document, which becomes the design’s proof (proofId); a correction whose proof cannot be rendered is refused, and writes nothing. Or, with proofToken instead, makes a correction proof’s document the design’s next revision and that proof the design’s proof, refused proof_not_for_design for a proof of another design, or of no design, proof_adjusts_layout for a layout adjustment’s proof, which POST /v1/designs/standing takes, and revision_changed once the design has moved past the revision the proof was made from. Emits design.edited. A correction that leaves the document as it is writes nothing — not a revision, not a cleared approval, not an event — and answers edited: false. Refused once any print of the design has an order.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The token POST /v1/designs/{id}/correction-proofs answered for this design. The design must still be at the revision the proof was made from.
object
The design’s revision as the caller read it. When the design has been corrected since, the correction is refused revision_changed.
What to change, in the shape a commit’s values take: an object keyed by the layerId of a field of the design’s correctionForm, each holding an object of that field’s prop and its new value, such as {"<layerId>": {"<prop>": "new wording"}}. Applied on top of the design as it is, so anything not named stays as it was.
object
Examples
Design to order: Correcting a design before it is ordered
{ "expectedRevision": 1, "values": { "namn": { "content": "Merry Christmas" } }}Example
{ "expectedRevision": 2, "values": { "name": { "content": "Alexandra L." } }}Sending the customer back to the store: Correcting a design from the store
{ "proofToken": "EXAMPLE_correction_proof_token_not_a_real_one"}Responses
Section titled “Responses”Corrected, and awaiting approval; or nothing to correct
object
Whether this correction wrote a revision. False when it left the document as it was: nothing was written, the approval stands, and revision is the current one.
The pictures that print below printFloorDpi at the design’s print size. A warning: nothing is refused for it.
object
The picture’s pixels along the edge that decides.
Pixels per inch along that edge, as printed.
The layer the picture fills, or the artwork’s own key for its image background.
The pixels that edge needs at the floor.
The minimum print resolution the design’s pictures were judged against: the template’s own, else the tenant’s.
The design’s proof now: the one rendered of the revision this wrote, or, when nothing was written, the proof the design already had (null when it has none). Its image is GET /v1/designs/{id}/proof.
Examples
Design to order: Correcting a design before it is ordered
{ "edited": true, "lowResolution": [], "printFloorDpi": 150, "proofId": "prf_9c1e2d3f4a5b6c7d8e9f0a1b", "revision": 2}Example
{ "edited": true, "lowResolution": [], "printFloorDpi": 150, "proofId": "prf_5d6e7f8a9b0c1d2e3f4a5b6c", "revision": 3}Sending the customer back to the store: Correcting a design from the store
{ "edited": true, "lowResolution": [], "printFloorDpi": 150, "proofId": "prf_9c1e2d3f4a5b6c7d8e9f0a1b", "revision": 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: bad_request
object
Examples
bad_request
{ "error": "bad_request"}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, 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, unknown_proof
object
Examples
not_found
{ "error": "not_found"}unknown_proof
{ "error": "unknown_proof"}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_editable, revision_changed, proof_not_for_design, proof_adjusts_layout
object
ordered: a print of the design has an order, so it is what was made; duplicate it instead. erased: the design’s personal data was erased, and it takes nothing more. cut_from_layout: the design is one placement’s print cut from a panel layout’s canvas; commit a new design through the layout (POST /v1/designs/layout) instead. linked: the design is one placement’s print of a linked group, which one design drives; commit the group’s placements again instead. Always sent with not_editable.
Always sent with revision_changed.
Examples
not_editable
{ "error": "not_editable", "reason": "erased"}proof_adjusts_layout
{ "error": "proof_adjusts_layout"}proof_not_for_design
{ "error": "proof_not_for_design"}revision_changed
{ "error": "revision_changed", "revision": 0}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: proof_expired
object
Examples
proof_expired
{ "error": "proof_expired"}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: asset_map_too_large, constraint_violation, design_doc_unreadable, payload_too_large
object
Always sent with asset_map_too_large, and may be sent with payload_too_large.
Always sent with asset_map_too_large, payload_too_large.
Always sent with constraint_violation.
object
On a text_draws_fallback_glyphs or text_draws_missing_glyphs warning: the characters the text’s font cannot draw, each once, in the order the text first holds them. Absent on every other violation.
The language whose overrides break the rule, when only the template as it reads in that language does. Absent, the original.
error refuses a publish; warning is worth the author’s attention and never does.
Examples
asset_map_too_large
{ "bytes": 0, "error": "asset_map_too_large", "maxBytes": 0}constraint_violation
{ "error": "constraint_violation", "violations": [ { "given": {}, "layerId": "string", "prop": "string", "rule": "string", "severity": "error" } ]}design_doc_unreadable
{ "error": "design_doc_unreadable"}payload_too_large
{ "error": "payload_too_large", "maxBytes": 0}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.
The caller left before the render started
object
Examples
client_closed_request
{ "error": "client_closed_request"}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, render_failed. A request that failed unexpectedly answers as text instead.
object
Examples
db_error
{ "error": "db_error"}render_failed
{ "error": "render_failed"}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: assets_unavailable, lock_timeout
object
Examples
assets_unavailable
{ "error": "assets_unavailable"}lock_timeout
{ "error": "lock_timeout"}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].