Render a design on a product photo
const url = 'https://api.pixonaut.app/v1/designs/example/mockup.png';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/designs/example/mockup.png \ --header 'Authorization: Bearer <token>'Operation ID: designs.mockup.get
The design drawn into the print area of its blank’s photo and blended with its shading, exactly as GET /t/{id}/mockup.png draws a template: what a store shows in its cart, order pages and emails once the customer has committed. The artwork is the design’s newest revision with a proof, as the customer was shown it. Left out, placementId is the design’s own placement, viewId the view its proof was previewed in, else the placement’s first view, and variant the variant its proof was previewed on, else the view’s default photo; mockupId names a photo instead. size caps the long edge in pixels. v, the design’s proofId, names the picture in the URL, so the answer is cached immutable; a v naming any other proof is refused proof_changed. An unknown design, placement, view, photo or variant, and a photo that is gone, are all not_found. A design with no proof, or whose personal data was erased, is proof_not_found, as its proof is. A design whose document the current model cannot read is refused design_doc_unreadable. A studio member reads it with their session, in the workspace the x-tenant-id header names.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”A placement of the design’s blank. Left out, the design’s own.
A placement of the design’s blank. Left out, the design’s own.
One of the placement’s views. Left out, the view the design’s proof was previewed in, else the placement’s first view.
One of the placement’s views. Left out, the view the design’s proof was previewed in, else the placement’s first view.
A variant ref of the blank: the view’s photo that shows it. Left out, the variant the design’s proof was previewed on, else the view’s default photo.
A variant ref of the blank: the view’s photo that shows it. Left out, the variant the design’s proof was previewed on, else the view’s default photo.
One of the placement’s photos, by id, in place of a view and variant.
One of the placement’s photos, by id, in place of a view and variant.
The long edge in pixels, clamped to the sizes the api renders.
The long edge in pixels, clamped to the sizes the api renders.
The design’s proofId. When it matches, the answer is cached immutable; when it names any other proof, it is refused proof_changed.
The design’s proofId. When it matches, the answer is cached immutable; when it names any other proof, it is refused proof_changed.
Responses
Section titled “Responses”The design on the product photo
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’s copy, named by its ETag, is current
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, proof_not_found, proof_changed
object
Examples
not_found
{ "error": "not_found"}proof_changed
{ "error": "proof_changed"}proof_not_found
{ "error": "proof_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: mockup_rect_unusable, mockup_rect_outside_photo, mockup_placed_box_empty, photo_decode_failed, mockup_mesh_unusable, mockup_cut_unusable, mockup_mask_decode_failed, mockup_uv_decode_failed, mockup_uv_pass_mismatch, design_doc_unreadable, asset_map_too_large, invalid_query
object
Always sent with asset_map_too_large.
Always sent with asset_map_too_large.
Examples
asset_map_too_large
{ "bytes": 0, "error": "asset_map_too_large", "maxBytes": 0}design_doc_unreadable
{ "error": "design_doc_unreadable"}invalid_query
{ "error": "invalid_query"}mockup_cut_unusable
{ "error": "mockup_cut_unusable"}mockup_mask_decode_failed
{ "error": "mockup_mask_decode_failed"}mockup_mesh_unusable
{ "error": "mockup_mesh_unusable"}mockup_placed_box_empty
{ "error": "mockup_placed_box_empty"}mockup_rect_outside_photo
{ "error": "mockup_rect_outside_photo"}mockup_rect_unusable
{ "error": "mockup_rect_unusable"}mockup_uv_decode_failed
{ "error": "mockup_uv_decode_failed"}mockup_uv_pass_mismatch
{ "error": "mockup_uv_pass_mismatch"}photo_decode_failed
{ "error": "photo_decode_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: 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: artwork_decode_failed, encode_failed, downscale_size_overflow, input_too_large, mockup_warp_unreadable, mockup_mesh_unreadable, mockup_cut_unreadable, mockup_uv_view_missing, composite_failed, db_error, render_failed. A request that failed unexpectedly answers as text instead.
object
Examples
artwork_decode_failed
{ "error": "artwork_decode_failed"}composite_failed
{ "error": "composite_failed"}db_error
{ "error": "db_error"}downscale_size_overflow
{ "error": "downscale_size_overflow"}encode_failed
{ "error": "encode_failed"}input_too_large
{ "error": "input_too_large"}mockup_cut_unreadable
{ "error": "mockup_cut_unreadable"}mockup_mesh_unreadable
{ "error": "mockup_mesh_unreadable"}mockup_uv_view_missing
{ "error": "mockup_uv_view_missing"}mockup_warp_unreadable
{ "error": "mockup_warp_unreadable"}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: asset_store_unavailable, assets_unavailable
object
Examples
asset_store_unavailable
{ "error": "asset_store_unavailable"}assets_unavailable
{ "error": "assets_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].