ランキング式の作成 create-ranking-formula
Offer Library API に対して POST リクエストを実行することで、ランキング式を作成できます。
Accept ヘッダーと Content-Type ヘッダー
リクエストヘッダーの Content-Type フィールドを構成する有効な値を次の表に示します。
ヘッダー名
値
Content-Type
application/json
API 形式
POST /{ENDPOINT_PATH}/ranking-formulas
パラメーター
説明
例
{ENDPOINT_PATH}永続性 API のエンドポイントパス。
https://platform.adobe.io/data/core/dpsリクエスト
curl -X POST 'https://platform.adobe.io/data/core/dps/ranking-formulas' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {IMS_ORG}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-d '{
"name": "Test Ranking Function DPS",
"description": "Ranking function description",
"exdFunction": true,
"returnType": {
"type": "integer"
},
"expression": {
"type": "PQL",
"format": "pql/text",
"value": "if(offer.rank.priority.isNotNull(), offer.rank.priority, 0) * if(offer.tags.intersects(boosted.tags), 2, 1)"
},
"definedOn": {
"offer": {
"schema": {
"altId": "_experience.offer-management.personalized-offer",
"version": "0"
}
},
"boosted": {
"schema": {
"altId": "_xdm.context.foo",
"version": "0"
}
}
}
}'
応答
応答が成功すると、id を含む、新規作成したランキング式の詳細が返されます。後の手順で id を使用して、ランキング式を更新または削除できます。
{
"etag": 1,
"createdBy": "{CREATED_BY}",
"lastModifiedBy": "{MODIFIED_BY}",
"id": "{ID}",
"sandboxId": "{SANDBOX_ID}",
"createdDate": "2023-05-31T15:09:11.771Z",
"lastModifiedDate": "2023-05-31T15:09:11.771Z",
"createdByClientId": "{CREATED_CLIENT_ID}",
"lastModifiedByClientId": "{MODIFIED_CLIENT_ID}"
}
recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76