Restore an earlier revision of a design
const url = 'https://api.pixonaut.app/v1/designs/example/revisions/example/restore';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"expectedRevision":3}'};
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/designs/example/revisions/example/restore \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "expectedRevision": 3 }'Operation ID: designs.revisions.restore
A correction whose document is the named revision’s: it is added as the design’s next revision, and the design goes back to awaiting approval, as after any correction, with a proof of its own rendered now (proofId). Emits design.edited with restoredFrom. A revision whose document is the current one writes nothing, and answers restored: false. Refused once any print of the design has an order, and for a revision the current model can no longer read.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A revision number.
A revision number.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The design’s revision as the caller read it. When the design has been corrected since, the correction is refused revision_changed.
Examples
Example
{ "expectedRevision": 3}Responses
Section titled “Responses”The design’s revision now
object
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.
Whether this restore wrote a revision. False when the named revision’s document already was the current one: nothing was written, and revision is the current one.
Examples
Example
{ "proofId": "prf_7a8b9c0d1e2f3a4b5c6d7e8f", "restored": true, "revision": 4}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, invalid_id
object
Examples
bad_request
{ "error": "bad_request"}invalid_id
{ "error": "invalid_id"}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
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: not_editable, revision_changed
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"}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: asset_map_too_large, 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.
Examples
asset_map_too_large
{ "bytes": 0, "error": "asset_map_too_large", "maxBytes": 0}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].