Get
/api/2/Preview/GetPreview?websiteId={websiteId}&webApiClientKey={webApiClientKey}&customizedProductId={customizedProductId}&userId={userId}&viewCode={viewCode}&isThumbnail={isThumbnail}&isGuest={isGuest}
This API is used to show the preview images of the customized products on the webstore and on the artifi admin.
When this API is called it returns the images of a product whose product id is passed in the key of the parameter ‘customizedProductId’, in an iframe with all the views of that product as shown in the below picture.

It returns the response object, which contains the status of the operation along with the message if any error occurs during this process.
Request Information
Parameters
Parameter Name | Description |
WebsiteId (Int) | This param refers to the website associated with customized products. The admin user of Artifi can create one or more websites and assign products to each of them. The ID of the website with which specified customized products are associated should be specified in this parameter. |
WebApiClientKey (String) | When any company registers with Artifi, Artifi will generate a special and unique key for that company, which will be called the client key. This client key can be found in the registered company's profile tab in the Artifi Account. This client key will be used for client (company) authentication and will be referred to as WebApiClientKey. |
customizedProductId (Int) | This parameter has the product id/s of the SKUs that are being added to the cart. The IDs are in comma separated format for more than one SKUs. |
userId (String) | This will be the ID of the ecommerce website's user, whether it be a registered or a guest user. If the user is registered, pass the user ID in this parameter. If the user is not registered with the e-commerce website, create a temporary ID for the user and pass that temporary ID in this parameter. The non-registered user will be referred to as a guest user, and this will be their unique user ID. The method will return the product customized by the user whose ID is specified in this parameter. |
Viewcode (String) | 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. |
isThumbnail (Boolean) |
|
isGuest (Boolean) | If this parameter is ‘true’ the user customizing the product is a guest checkout user. |
Response Information
Response body formats
On Success
On success, this method will revert with an iframe that will contain the images of all the views of the products with their respective customization.
On Error
On error, this method will call back the JavaScript method in the website which is specified in the "errorCallback" parameter with errorMessage.
Error can occur if any of the parameters is passed with the wrong key value of data type.
Example:
{
"Response": "Error",
"Message": "Invalid webapiclientkey.",
"Data": null,
"ErrorCode": "226"
}