XOMNI: Experience Omni-Channel

Last Updated: February 19, 2016

This API is used to fetch relationships between assets and items. Using this API, you can get a list of images assigned to a particular item. You can also specify asset metadata key value pair to get the specific images for a particular item.

Request

HTTP Method Resource URI
GET https://{tenantName}.api.xomni.com/catalog/items/{itemId}/images?metadataKey={metadataKey}&metadataValue={metadataValue}&assetDetail={assetDetail}

URI Parameters

Parameter Name Description Type Conditions
itemId The unique ID of the item. Number
metadataKey Optional field for querying assets with their metadata. You can send metadata key filter using this field. String
metadataValue Optional field for querying assets with their metadata. You can send metadata value filter using this field. String
assetDetail An integer field indicating whether the response contains item assets details (Default value is 4. See Possible values for AssetDetail below). Number

Possible Values For ImageAssetDetail

Value Description
1 Includes only default asset.
2 Includes only default asset with metadata.
4 Includes all assets.
8 Includes all assets with metadata.

Request Headers

Header Field Name Description
Content-Type
Content type of the response entity. The value of this header is always application/json.
Accept
Includes minor version header.
Sample: application/vnd.xomni.api-v4-0, */*
Authorization
Access or identity token taken from oauth APIs.
Sample: Bearer dc8f1dcdbe454da8a25621839a93569337522968019e4bd7becd6e01285444da

Response

{
    "Data": [
        {
            "AssetMetadata": [
                {
                    "Key": "assetmetadatakey1",
                    "Value": "assetmetadatavalue1"
                },
                {
                    "Key": "assetmetadatakey2",
                    "Value": "assetmetadatavalue2"
                }
            ],
            "AssetId": 4,
            "AssetUrl": "https://xomni.blob.core.windows.net/images/ec741f00-b9bf-49c8-a618-33e419695717",
            "IsDefault": false,
            "ResizedAssets":[
              {
                  "ImageSizeProfile":{
                      "Id":1,
                      "Height":100,
                      "Width":200
                  },
                  "AssetUrl":"http://xomni.blob.core.windows.net/resizedassets/test-resizedasset"
              }
           ],
        },
        {
            "AssetMetadata": [
                {                    
                    "Key": "assetmetadatakey1",
                    "Value": "assetmetadatavalue1"
                },
                {
                    "Key": "assetmetadatakey5",
                    "Value": "assetmetadatavalue5"
                }
            ],
            "AssetId": 5,
            "AssetUrl": " https://xomni.blob.core.windows.net/images/bd0b8aba-3194-4e73-93d8-f5a2c6832d7f",
            "IsDefault": true,
	 "ResizedAssets":null,
        }
    ]
} 

Response Body Description

Parameter Name Description Type
Data[0..N].IsDefault Boolean field indicating whether this asset is the default image of the related object or not. Boolean
Data[0..N].AssetId The unique ID of the asset. Number
Data[0..N].AssetUrl The unique URL of the asset. String
Data[0..N].AssetMetadata[0..N].Key The key for the metadata. String
Data[0..N].AssetMetadata[0..N].Value The value of the metadata. String
Data[0..N].ResizedAssets[0..N].AssetUrl The unique URL of the asset. String
Data[0..N].ResizedAssets[0..N].ImageSizeProfile.Id The unique ID of the resized asset size profile. Number
Data[0..N].ResizedAssets[0..N].ImageSizeProfile.Height Height of the resized asset. Number
Data[0..N].ResizedAssets[0..N].ImageSizeProfile.Width Width of the resized asset. Number

Response Headers

Header Field Name Description
Content-Type
Content type of the response entity. The value of this header is always application/json.

Status Codes

A successful operation returns status code 200 (OK) for GET operations. Possible response status codes are as listed below:

Status Code Description
404 (Not Found) No image has been found for the given item.
404 (Not Found) The given item could not be found.