1. Introduction
The Upload User Image API allows users to upload image files to the Artifi platform. This API is used to store and manage user-provided media, which can then be utilized in product customization, design workflows, or other platform features.
Optional Feature: DPI (Dots Per Inch) configuration.
2. API Endpoint
Method: POST
URL: /api/4/UploadImage/UploadImage
3. Query Parameters
userId (string, required): Unique identifier of the e-commerce user. For registered users, pass the existing ID. For guest users, generate and pass a temporary unique ID.
DPI (int, optional): Specifies the DPI of the uploaded image.
4. Request Headers
Header | Type | Required | Description |
websiteId | int | Yes | Must be numeric and not 0 |
webApiClientKey | string | Yes | Client authentication key |
Content-Type | string | Yes | multipart/form-data |
5. Request Body (Form Data)
Parameter | Type | Required | Description |
postedFile | file | Yes | Image file to upload |
userId | string | Yes | Unique user identifier |
dpi | int | No | Image DPI |
6. Sample Request
POST /api/4/UploadImage/UploadImage?userId=12345&DPI=96
Headers: websiteId=1001, webApiClientKey=abc123
Body: multipart/form-data with postedFile
7. Success Response
Returns image metadata including ID, dimensions, DPI, and URLs.
{
"Response": "Success",
"Message": "",
"Data": {
"Id": 340927,
"ImageName": "ArtifiLogo.png",
"UniqueName": "...",
"Width": 355,
"Height": 142,
"DPI": 96,
"Extension": ".png",
"MimeType": "image/png",
"PhotoCode": "340706",
"OriginalURL":"OriginalURL",
"StandardURL": "StandardURL"
},
"ErrorCode": ""
}
8. Error Handling
Code | Message |
372 | Missing websiteId |
221 | Invalid websiteId |
226 | Empty webApiClientKey |
261 | Invalid userId |
262 | Invalid or missing file |
265 | Invalid DPI value |
500 | Server error |
.