Skip to navigation

Upload a new image

View as Markdown

Uploads a single image file with optional quality setting. The image is processed and stored with an MD5 hash as its identifier. Content-based deduplication ensures that identical images are not stored multiple times per customer. Images are stored per customer but metadata is tracked per chain.

Important: Only one file can be uploaded per request. Requests with multiple files will be rejected with a 400 BadRequest response.

Quality Options:

QualityMax DimensionsEncoding QualityOutput FormatUse Case
originalNo resizing100% (lossless)WebPWhen exact original is needed
high1024x1024 px90%WebPProduct images, detailed photos
medium512x512 px80%WebPDefault, balanced quality/size
low128x128 px60%WebPThumbnails, low bandwidth

Notes:

  • Maximum file size: 10MB. Requests exceeding this will be rejected with a 400 BadRequest response.
  • All resizing maintains aspect ratio (images are scaled to fit within max dimensions)
  • WebP format provides better compression than JPEG while maintaining quality
  • Original quality preserves the image without any quality loss
  • Supported input formats: PNG, JPEG, WebP, GIF, BMP

Optional Associations (Two Approaches):

You can associate images with articles and viewgroups using either of these approaches:

**Approach 1: Query Parameters ** Simplest as it is not needed to store the imageId for subsequent calls

**Approach 2: Entity APIs

  • For Articles: Use POST /articles/v1/chain/{chainId} with images array in the request body
    • Example: "images": [{"imageId": "abc123", "isDefault": 1}]
    • This updates the article entity with the image reference
  • For ViewGroups: Use POST /viewGroups/v1/chain/{chainId} with imageId field in the request body
    • Example: "imageId": "abc123"
    • This updates the viewgroup entity with the image reference

Example Request:

POST /images/v1/chain/1?quality=medium&articleId=1234567890123
Content-Type: multipart/form-data
file: [binary image data]

Response Headers:

  • Location - URL to track the processing status (e.g., /BaseData/v1/id/{baseDataId})

Path parameters

chainintegerRequired
The ID of the chain

Query parameters

qualitystringOptionalDefaults to medium

Image quality setting: original, high, medium (default), or low

articleIdlongOptional

Optional: Associate this image with an article by providing the articleId

viewGroupIdlongOptional

Optional: Associate this image with a viewgroup by providing the viewGroupId

Request

This endpoint expects a multipart form containing a file.
filefileRequired

Image file to upload (PNG, JPEG, WebP, GIF, BMP; max 10MB)

Response

Image uploaded successfully. Response body contains image metadata and Location header points to status tracking endpoint.

Errors

400
Bad Request Error