Get Images

GetImage API Signature

{DomainName}/Designer/Image/GetImage?websiteId={websiteId}&webApiClientKey= {webApiClientKey}&sku={Artifi Product SKU}or{StyleNumber}or{StyleNumber_OmsCode}

Example:

Product Image

https://imagelab.artifi.net//Designer/Image/GetImage?websiteId=136&webApiClientKey=5dd78a25-c22d-4ffe-a36e-b803f90702af&sku=81FOC

Product Image With Width & Height:

https://imagelab.artifi.net//Designer/Image/GetImage?websiteId=136&webApiClientKey=5dd78a25-c22d-4ffe-a36e-b803f90702af&sku=81FOC&width=1000&height=1000

Product Image With OMS Color :

https://imagelab.artifi.net//Designer/Image/GetImage?websiteId=136&webApiClientKey=5dd78a25-c22d-4ffe-a36e-b803f90702af&sku=81FOC_800&width=1000&height=1000

Product Image With OMS Color & Max Logo Decoration Area:

https://imagelab.artifi.net//Designer/Image/GetImage?websiteId=136&webApiClientKey=5dd78a25-c22d-4ffe-a36e-b803f90702af&sku=81FOC_800&width=1000&height=1000¶meters=[{"type":"image","widget_key":"RC","src":"44505"}]

Product Image With OMS Color & Requested Logo Decoration Area:

https://imagelab.artifi.net//Designer/Image/GetImage?websiteId=136&webApiClientKey=5dd78a25-c22d-4ffe-a36e-b803f90702af&sku=81FOC_800&width=1000&height=1000&parameters=[{"type":"image","widget_key":"RC","src":"44505","width":"2.750"}]&ConversionUnit=in

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

NameDescriptions
typetextbox
widget_key    Widget key of your text that you want to update. This widget key should be available on the Admin template.
fillColor hex value. The default color we are getting from the rule assigned to the widget.
fontFamilyFont Family Name. Default font family we are getting from the rule assigned to the widget.

fontFamily is mandatory for the embroidery deco method.
fontWeightFont decoration “bold”,” normal”

left

Left position of the widget.

Top Position of Widget

topTop Position of Widget

width
Width of Widget.
heightHeight of Widget
dm_codeDecoration Method code (e.g : DE)
Image Properties
NameDescriptions
typeimage
widget_key    Widget key of your image that you want to update. This widget key should be available in the Admin template.
src

Clipart code for applying the specific logo.

For user-uploaded images, the user must pass an image's unique name with an extension to the src.

Ex: 2142351fe8964-7517-49df-a749-649bc2e3b705.png Ex. URL: link

is_external_img

A boolean value if a user uploaded a photo is to be rendered.

This attribute mandatorily needs to be passed with true value, if you want to render a user uploaded image, instead of clipart.

Ex. URL: link 

leftLeft position of the widget.
topTop Position of Widget.
width

Width of Widget/logo in px or inches. In order to apply decoration in inches, the admin decoration should be available in inches and conversionUnit=’in’ in base param.

height

Height of Height. In order to apply decoration in inches, the admin

decoration should be available in inches and conversionUnit=’in’ in base param.

customFiltersEffects of Clipart ex:

[

  {

    "type": "image",

    "src": "61354",

    "widget_key": "FRT",

    "customFilters": [

      {

        "Type": "RemoveBackground",

        "ToleranceFactor": 10,

        "Color": "#ffffff"

      },

      {

        "Type": "Tint",

        "Color": "#4D00FF",

        "Opacity": 0.7

      },

      {

        "Type": "Grayscale"

      },

      {

        "ToleranceFactor": 15,

        "Type": "BlackAndWhite"

      }

    ]

  }

]

 
RemoveBackground: Effect: By applying this effect, we can remove the white background of the image. Ex:

[

  {

    "type": "image",

    "src": "61354",

    "widget_key": "FRT",

    "customFilters": [

      {

        "Type": "RemoveBackground",

        "ToleranceFactor": 10

       }

    ]

  }

]


NameDescriptions
TypeType of Effect Name (RemoveBackground).

ToleranceFactor    

The quality factor of the image


Tint Effect: By applying this effect, we can apply any color to the image.

Ex

[

  {

    "type": "image",

    "src": "61354",

    "widget_key": "FRT",

    "customFilters": [

           {

        "Type": "Tint",

        "Color": "#4D00FF",

        "Opacity": 0.7

      }

    ]

  }

]

NameDescriptions
TypeType of Effect Name (Tint )
ColorSpecify color for image widget
OpacityOpacity of Widget

Grayscale Effect: By applying this effect, we can get a gray image.

Ex:

[

  {

    "type": "image",

    "src": "61354",

    "widget_key": "FRT",

    "customFilters": [

           {

        "Type": "Grayscale"

      }

    ]

  }

]

NameDescriptions
TypeType of Effect Name(Grayscale)
BlackAndWhite Effect: By applying this effect we can get a black and white widget.

[

  {

    "type": "image",

    "src": "61354",

    "widget_key": "FRT",

    "customFilters": [

            {

        "ToleranceFactor": 15,

        "Type": "BlackAndWhite"

      }

    ]

  }

]

NameDescriptions
TypeName of Effect Name(BlackAndWhite)
ToleranceFactor    

The quality factor of the image



dm_codeDecoration Method code (e.g : DE)

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}

  1. 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.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.