Upload Image

Post


/api/3/UploadImage/UploadImage?websiteId={websiteId}&userId={userId}&webApiClientKey={webApiClientKey}&dpi={dpi}

The Upload Image API allows users to upload images to the system. This API is used for custom product designs, user profile pictures, and other media uploads in Artifi. Once uploaded, the image can be used for further customization or processing.

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.

userId

This will be the id of your e-commerce website's user. The user can be registered or a guest user.

If the user is registered, pass the user id in this parameter, and if the user is not registered with your e-commerce website, create a temporary id for the user and pass that temporary id in this parameter.

The non-registered users are called as guest users, and this is their unique user ID.

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.

The client key will be used for client (company) authentication and will be referred to as WebApiClientKey.

dpi

This parameter states the Output image DPI value of the output image. If no value is passed, the default value 72 DPI is considered.

Response Information

Response body formats


On Success

On success, this method will call back the JavaScript method in the website which is specified in the "successCallback" parameter with success Message.

Success Response:

{

    "Response": "Success",

    "Message": "",

    "Data": {

        "Id": 293340,

        "ImageName": "06ca3ca2-c5a9-4e5e-b413-3fea068145a5.jpg",

        "UniqueName": "a916f990-68a6-4637-a015-2a69fd6eae7c.jpg",

        "Width": 1330,

        "Height": 1473,

        "DPI": 72,

        "Extension": ".jpg",

        "MimeType": "image/jpeg",

        "PhotoCode": "293340"

    },

    "ErrorCode": ""

}

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 Response:

{

  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",

  "title": "One or more validation errors occurred.",

  "status": 400,

  "errors": {

    "": [

      "Failed to read the request form. Missing content-type boundary."

    ]

  },

  "traceId": "00-5140e99c1fdb4472d8164edf7b705314-acd845afb4469989-00"

}

Did you find it helpful? Yes No

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