Asset Model Reference

Complete property reference for the Asset model in Omnium, including URLs, metadata, and custom properties.

This page documents all properties of the Asset model used for product images, documents, and media files.


Asset Properties

PropertyTypeDescription
AssetIdstringUnique identifier for the asset
AssetTypestringType classification (e.g., image, document)
NamestringDisplay name
DescriptionstringShort description
AltTextstringAlternative text for images (accessibility/SEO)
PurposestringAsset purpose or use case (e.g., hero, thumbnail)
SortOrderint?Display order when listing assets
IsMainImageboolFlag indicating if asset is the main product image
ParentIdstringOptional parent folder/directory ID

URL Properties

PropertyTypeDescription
UrlstringInternal Omnium URL (set after upload)
ExternalUrlstringExternal URL to be downloaded and stored in Omnium

File Properties

PropertyTypeDescription
FileNamestringFile name including extension (e.g., product.jpg)
ContentTypestringMIME type (e.g., image/jpeg, application/pdf)
LengthlongFile size in bytes
ContainerstringStorage container name
InternalNamestringInternal reference name
FileLoaderTypestringType of file loader used

Upload Control

PropertyTypeDescription
ForceUploadbool?Force upload external URL even if internal URL exists
Base64EncodedContentstringOptional base64-encoded file content for direct upload

Metadata

PropertyTypeDescription
PropertiesList<PropertyItem>Custom key-value properties
CreatedDateTimeCreation timestamp
ModifiedDateTimeLast modification timestamp

Key Concepts

AssetId

The AssetId is a unique identifier for each asset. If not provided during creation, a GUID is automatically generated:

{
  "assetId": "product-image-001"
}

URL Handling

Assets support two URL properties that work together:

ScenarioExternalUrlUrlBehavior
New assetSetEmptyExternal URL is downloaded to Omnium storage, Url is set
Uploaded assetAnySetUses existing internal URL
Force re-uploadSetSetRe-downloads external URL if ForceUpload is true
{
  "externalUrl": "https://supplier.com/images/product.jpg",
  "url": null
}

After processing:

{
  "externalUrl": "https://supplier.com/images/product.jpg",
  "url": "https://cdn.example.com/products/product.jpg"
}

IsMainImage

The IsMainImage flag designates the primary product image:

  • Only one asset per product should have IsMainImage: true
  • The main image URL is synchronized to Product.MainImageUrl
  • Main image is typically shown in product listings and search results
{
  "assets": [
    {
      "assetId": "product-image-001",
      "externalUrl": "https://example.com/front.jpg",
      "isMainImage": true
    },
    {
      "assetId": "product-image-002",
      "externalUrl": "https://example.com/back.jpg",
      "isMainImage": false
    }
  ]
}

Purpose

The Purpose property categorizes assets by their intended use:

PurposeDescription
heroLarge banner/hero image
thumbnailSmall preview image
galleryProduct gallery image
detailDetailed/zoom image
lifestyleLifestyle/contextual image
documentationProduct manuals, spec sheets

Configure valid purpose values in tenant settings via AssetPurposeKeys.

SortOrder

Control asset display order with SortOrder:

{
  "assets": [
    { "assetId": "product-image-001", "sortOrder": 1 },
    { "assetId": "product-image-002", "sortOrder": 2 },
    { "assetId": "product-image-003", "sortOrder": 3 }
  ]
}

Lower values appear first. Assets without SortOrder typically appear last.


Custom Properties

The Properties list allows storing arbitrary key-value metadata:

{
  "assetId": "product-image-004",
  "properties": [
    { "key": "photographer", "value": "John Smith" },
    { "key": "shootDate", "value": "2024-01-15" },
    { "key": "copyright", "value": "2024 Acme Corp" },
    { "key": "color", "value": "blue" }
  ]
}

Use cases:

  • Image credits and copyright
  • Color/variant associations
  • Campaign or season tagging
  • Custom filtering criteria

Complete Example

{
  "assetId": "product-image-005",
  "assetType": "image",
  "name": "Front View",
  "description": "Blue cotton shirt - front view",
  "altText": "Blue cotton button-down shirt, front view",
  "purpose": "gallery",
  "sortOrder": 1,
  "isMainImage": true,
  "externalUrl": "https://supplier.com/images/shirt-001-front.jpg",
  "url": "https://cdn.example.com/products/shirt-001-front.jpg",
  "fileName": "shirt-001-front.jpg",
  "contentType": "image/jpeg",
  "length": 245678,
  "container": "products",
  "properties": [
    { "key": "variant", "value": "blue" },
    { "key": "angle", "value": "front" }
  ],
  "created": "2024-01-15T10:30:00Z",
  "modified": "2024-01-15T10:30:00Z"
}

Base64 Content Upload

For direct binary uploads without an external URL, use Base64EncodedContent:

{
  "assetId": "product-image-006",
  "fileName": "custom-image.jpg",
  "contentType": "image/jpeg",
  "base64EncodedContent": "/9j/4AAQSkZJRgABAQEASABIAAD..."
}

Base64 encoding increases data size by approximately 33%. For large files, prefer using ExternalUrl or stream-based uploads.

On this page