GetImage API Signature
{DomainName}/Designer/Image/GetImage?websiteId={websiteId}&webApiClientKey= {webApiClientKey}&sku={Artifi Product SKU}or{StyleNumber}or{StyleNumber_OmsCode}
Example:
Product Image
Product Image With Width & Height:
Product Image With OMS Color :
Product Image With OMS Color & Max Logo Decoration Area:
Product Image With OMS Color & Requested Logo Decoration Area:
Using this API, you can get an image as per the parameters.
Enable CDN Cache
If the cache is disabled for the website from Artifi Admin, in that case, the following GetImage API URL needs to be used.
{DomainName}/Designer/Image/GetImage/NoCache?websiteId={websiteId}&webApiClientKey= {webApiClientKey}&sku={Artifi Product SKU}or{StyleNumber}or{StyleNumber_OmsCode}
Note: Pass decoration JSON in encoded format.
Request Information
Parameters
Name | Descriptions |
website | This is the website created in the Artifi account. |
webApiClientKey | When any company gets registered with Artifi, Artifi will generate a special and unique key for that company which will be called a client key. This client key can be found in the registered company's profile tab in Artifi Admin Account. |
Artifi Product SKU/StyleNumber/StyleNumber_OmsCode | This is a unique field to identify any product. In this field, users can send either Product base SKU/ProductCode or Variant SKU. This field should be matched with the product available in Admin. If Artifi receives the base product code/SKU and the product has variants, then we are sending back the default SKU details of that product. |
viewCode [Optional] | Optional field for GetImage API. This becomes mandatory when a specific view needs to be pulled. Otherwise, the default view image will be pulled. |
angleCode [Optional] | Optional field for GetImage API. This becomes mandatory when a specific angle needs to be pulled. Otherwise, the default angle image will be pulled. |
width [Optional] | The width of the output image. |
height [Optional] | The height of the output image. |
conversionUnit=In/px [Optional] | This param is used for applying decoration in inches or pixels. The default value is Px. |
format [Optional] | Format of the output image. Default extension/format of image is .png |
isProductImage[Optional] | This flag is used to get product base image forcefully. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isIgnoreAspectRatio[Optional] | If the user needs an output image in exact width and height then this flag will be enabled, otherwise, it resizes the image according to aspect ratio. The default value of this flag is false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isDesignImage[Optional] | This flag is used for getting only design details. The default value of this flag is always false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dpi[Optional] | Output image DPI value. Default is 72 DPI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IsZoom[Optional] | This parameter is used to get an image of high resolution. If its value is true then we will return a high-resolution image with a given height-width. If it is false then it will return a low-resolution image to 600px width and height. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
templateCode[Optional] | This parameter is used to get an image of a particular template apart from the default applied template to any view. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
parameters[Optional] | In order to apply any decoration over the product image/ view image, you need to pass these params in JSON encoded format. Ex. parameters= [{ "type":"textbox", "widget_key":"CL_Text", "text":"DJP", "fill":"#951357", "fontFamily":"Impact", "fontWeight":"normal", "vAlign":"middle","left":200.29,"top":200.44,"width":200.96,"height": 164.48,"dm_code":"DE" },{ "type":"image","src":"4","widget_key":"CR_Image","left":200.29,"top":200.44,"width":200.96, "height":164.48,"dm_code":"DE"}] Note : Pass decoration JSON in encoded format. Text Properties
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Decorationmethodcode (Optional) | In order to apply the embroidery effect to the product, on the basis of the decoration method code. |
GetImage Error Code
GetImage is an API that generates a customized product image according to the parameters passed in the API.
In case the API response fails due to any reason, it results in an error code with an error message stating the reason for failure.
An error code refers to a numeric or alphanumeric identifier that represents a specific error or exception that occurs during the personalization.
Error codes are used to provide information about the nature and cause of an error that helps to understand what is causing an error.
Following are the error codes and their corresponding descriptions:
Error Code: 226
Error Message: Invalid WebApiClientKey
Description: Invalid WebApiClientKey message appears when the WebApiClientKey parameter is empty or invalid.
Example with invalid webAPIClientKey: {DomainName}/Designer/Image/GetImage?websiteId={websiteId}&webApiClientKey= {Invalid WebAPIClientKey/Empty}&sku={Artifi Product SKU}or{StyleNumber}or{StyleNumber_OmsCode}
- Troubleshooting Tips: Verify that the webAPIClientKey has been entered correctly.
Error Code: 221,208
Error Message: Invalid Website Id. Division Id should not be empty, null, or zero.
Description: This error code and message appears in case of the missing or invalid Website Id.
Example with invalid websiteId:
{DomainName}/Designer/Image/GetImage?websiteId={Invalid websiteId/Empty}&webApiClientKey= {webApiClientKey}&sku={Artifi Product SKU}or{StyleNumber}or{StyleNumber_OmsCode}
- Troubleshooting Tips: Verify that the websiteId has been entered correctly.
Error Code: 250
Error Message: Invalid View Code
Description: The product image and the customization breaks if the view code is missing or invalid(which is not defined in the Artifi product setup).
Example with invalid View Code:
{DomainName}/Designer/Image/GetImage?websiteId={websiteId}&webApiClientKey= {webApiClientKey}&sku={Artifi Product SKU}or{StyleNumber}or{StyleNumber_OmsCode}&viewCode= {Invalid viewCode}
- Troubleshooting Tips: Verify that the viewCode has been entered correctly.
Error Code: 222
Error Message: Invalid Product Code/SKU
Description: This error code and message appears when the Product Code/SKU is invalid or empty.
Example with invalid Product Code/SKU:
{DomainName}/Designer/Image/GetImage?websiteId={websiteId}&webApiClientKey= {webApiClientKey}&sku={Invalid Product SKU}or{Invalid StyleNumber}or{Invalid StyleNumber_OmsCode}
- Troubleshooting Tips: Verify that the Product Code/SKU has been entered correctly.
Error Code:
Error Message: An error occurred.
Description: The error code is blank. The given error code message appears when the user passes an invalid JSON in the parameter or if there is any unhandled exception in the code.
Example with invalid Image Format: {DomainName}/Designer/Image/GetImage?websiteId={websiteId}&webApiClientKey= {webApiClientKey}&sku={Invalid Product SKU}or{Invalid StyleNumber}or{Invalid StyleNumber_OmsCode}parameters=[{Invalid JSON}]
- Troubleshooting Tips: Verify that the JSON has been passed correctly in the parameter key.