Introduction
The Get Preview Image API is used to retrieve a rendered 2D preview image of a customized product design within the Artifi platform.
When a user personalizes a product - such as adding text, clipart, or images - this API generates and returns a visual representation of the design for a specific product view. It plays a key role in enabling real-time visualization across various stages of the user journey, including product customization, order review, and administrative workflows.
This API is commonly consumed by frontend applications, order management systems, and design review tools to display the current state of a customized design. The response is returned as a binary image file (typically PNG), representing the rendered preview of the design.
Use Cases
- Product Personalization Preview
After a user adds text, images, or graphics to a product, the UI calls this API to display an updated live preview of the design.
- Order Confirmation Display
During checkout or order review, the API provides preview images for each customized product, helping users verify their selections before placing an order.
- Admin Design Review
Administrative users can retrieve and view design previews to inspect customer customizations without opening the design editor.
- Thumbnail Generation
By enabling thumbnail mode (e.g., isThumb = true), the API returns a smaller version of the design image, suitable for listings, galleries, or compact UI components.
- Multi-View Product Rendering
For products with multiple views (such as front, back, or sleeve), passing a specific viewCode allows retrieval of the preview for that particular view.
- Print Proof Validation
Production teams can use the preview image to validate the design before sending it for printing, ensuring quality and accuracy. - Design Sharing
- Applications that support sharing can use this API to generate preview images for embedding in emails, links, or social media platforms.
- Design History and Archive Display
When displaying previously saved or historical designs, the API can be used to fetch preview thumbnails for each design entry.
API Details
Endpoint
GET /api/4/ Preview/ GetPreviewImage
curl --location 'api.artifi.net/api/4/Preview/GetPreviewImage?designId=42815102&viewcode=153617&isThumbnail=false' \
--header 'websiteId: 167' \
--header 'webApiClientKey: c961461a-b287-448c-b9ea-e1162bd80b8e'
Parameters
Header Validation
Header Name | Type | Required | Description |
websiteId | int | Yes | Unique identifier of the website. |
webApiClientKey | string | Yes | API client key used for authentication. |
Query Parameters
Name | Type | Required | Default | Description |
DesignId | Integer | yes | - | This is the ID of the designed product that gets added to cart. Design ID is created when the user adds the customized product to the cart.
|
viewCode | string | Yes | - |
This is the ID of the view that is associated with the product. View Code is created when the user creates a view for a product in the Artifi admin. If the viewcode is not defined then the default view is fetched by the API. |
isThumbnail | Boolean | No | false | When true, returns a smaller thumbnail image instead of the full-size preview. |
Success Responses
Response Type: Binary image file (image/png) HTTP Status: 200 OK
- Returns the physical PNG preview image of the design directly as a file stream.
- If isThumb=true, a reduced-resolution thumbnail is returned.
- If isThumb=false, the full standard-size preview image is returned.
Error Code List (Click Here)
Q&A
Q1. What format does the API response use?
The API returns a binary PNG image file directly, not a JSON response.
Q2. Is authentication required to call this API?
No, authentication is not required. The endpoint is decorated with [AllowAnonymous].
Q3. What happens if the ViewCode parameter is not provided?
If ViewCode is not specified, the API renders and returns the default view of the design.
Q4. What is the difference between isThumb=true and isThumb=false?
- isThumb=true returns a smaller thumbnail version of the design image.
- isThumb=false returns the standard-size preview image.
Q5. What happens if the design image file does not exist on the server?
If the image file is not found, the API returns a successful (200 OK) response with an empty body.
Q6. Can this API be used for products with multiple views?
Yes, the API supports multi-view products. You can pass a specific ViewCode to retrieve the preview for a particular view.
Q7. What can cause a 500 Internal Server Error?
A 500 error typically occurs due to unhandled server-side exceptions during image generation. These errors are logged for further investigation.