カスタムの自動照合
デフォルトの自動一致戦略(OOTB 自動一致)が特定のビジネス要件に合っていない場合は、「カスタム一致」オプションを選択します。 このオプションは、複雑なマッチングロジックを処理するカスタムマッチャーアプリケーションや、メタデータをAdobe Developer App Builderに入力できないサードパーティシステムからのアセットを開発する 0}AEM Assets} の使用をサポートします。
カスタムの自動照合を設定
-
Commerce管理者から、Store /設定/ ADOBE SERVICES / AEM Assets Integration に移動します。
-
一致ルールとして「Custom Matcher」を選択します。
-
この一致ルールを選択すると、カスタム一致ロジックに必要な 認証パラメーター および エンドポイント を設定するための追加フィールドが表示されます。
カスタムマッチャー API エンドポイント
App Builder を使用してカスタムマッチャーアプリケーションを作成する場合、アプリケーションは次のエンドポイントを公開する必要があります。
- App Builder asset to product URL endpoint
- App Builder製品からアセットの URL エンドポイント
App Builder asset to product URL endpoint
このエンドポイントは、特定のアセットに関連付けられた SKU のリストを取得します。
使用例
const { Core } = require('@adobe/aio-sdk')
async function main(params) {
// Build your own matching logic here to return the products that map to the assetId
// var productMatches = [];
// params.assetId
// params.eventData.assetMetadata['commerce:isCommerce']
// params.eventData.assetMetadata['commerce:skus'][i]
// params.eventData.assetMetadata['commerce:roles']
// params.eventData.assetMetadata['commerce:positions'][i]
// ...
// End of your matching logic
return {
statusCode: 500,
body: {
asset_id: params.assetId,
product_matches: [
{
product_sku: "<YOUR-SKU-HERE>",
asset_roles: ["thumbnail", "image", "swatch_image", "small_image"],
asset_position: 1
}
]
}
};
}
exports.main = main;
リクエスト
POST https://your-app-builder-url/api/v1/web/app-builder-external-rule/asset-to-product
パラメーター
データタイプ
説明
assetId
文字列
更新されたアセット ID を表します。
eventData
文字列
アセット ID に関連付けられたデータペイロードを返します。
応答
{
"asset_id": "{ASSET_ID}",
"product_matches": [
{
"product_sku": "{PRODUCT_SKU_1}",
"asset_roles": ["thumbnail","image"]
},
{
"product_sku": "{PRODUCT_SKU_2}",
"asset_roles": ["thumbnail"]
}
]
}
App Builder製品からアセット URL のエンドポイント
このエンドポイントは、特定の SKU に関連付けられたアセットのリストを取得します。
使用例
const { Core } = require('@adobe/aio-sdk')
async function main(params) {
// return asset matches for a product
// Build your own matching logic here to return the assets that map to the productSku
// var assetMatches = [];
// params.productSku
// ...
// End of your matching logic
return {
statusCode: 500,
body: {
product_sku: params.productSku,
asset_matches: [
{
asset_id: "<YOUR-ASSET-ID-HERE>", // urn:aaid:aem:1aa1d5i2-17h8-40a7-a228-e3ur588deee1
asset_roles: ["thumbnail", "image", "swatch_image", "small_image"],
asset_format: "image", // can be "image" or "video"
asset_position: 1
}
]
}
};
}
exports.main = main;
リクエスト
POST https://your-app-builder-url/api/v1/web/app-builder-external-rule/product-to-asset
パラメーター
データタイプ
説明
productSKU
文字列
更新された製品 SKU を表します。
eventData
文字列
製品 SKU に関連付けられているデータペイロードを返します。
応答
{
"product_sku": "{PRODUCT_SKU}",
"asset_matches": [
{
"asset_id": "{ASSET_ID_1}",
"asset_roles": ["thumbnail","image"],
"asset_position": 1,
"asset_format": image
},
{
"asset_id": "{ASSET_ID_2}",
"asset_roles": ["thumbnail"]
"asset_position": 2,
"asset_format": image
}
]
}
パラメーター
データタイプ
説明
productSKU
文字列
更新された製品 SKU を表します。
asset_matches
文字列
特定の製品 SKU に関連付けられているすべてのアセットを返します。
asset_matches
パラメーターには、次の属性が含まれます。
属性
データタイプ
説明
asset_id
文字列
更新されたアセット ID を表します。
asset_roles
文字列
asset_format
文字列
アセットで使用可能な形式を提供します。 使用可能な値は
image
および video
です。asset_position
文字列
アセットの位置を表示します。
recommendation-more-help
c7f8bba7-a224-4875-a4b3-c2716835c81e