更新適用性規則 update-eligibility-rule

您可以透過向優惠資料庫API發出PATCH請求來修改或更新規則。

如需JSON修補程式的詳細資訊,包括可用的作業,請參閱官方JSON修補程式檔案。

condition.value引數包含套用規則時所評估的公式,其中會顯示​ 更多資訊 ​圖示。 segmentModel引數包含規則產生器顯示的模型。

IMPORTANT
若要變更適用性規則,請透過API僅更新condition.value,或在使用者介面中進行變更。 不支援透過API編輯segmentModel:這會讓規則停用,且無法在使用者介面中存取,因為使用者介面模型不再符合規則邏輯。 透過API更新的規則無法在使用者介面中可靠地重新開啟或編輯它。

Accept和Content-Type標頭

下表顯示請求標頭中包含Content-Type欄位的有效值:

標題名稱
值
Content-Type
application/json

API格式

PATCH /{ENDPOINT_PATH}/offer-rules/{ID}
參數
說明
範例
{ENDPOINT_PATH}
持續性API的端點路徑。
https://platform.adobe.io/data/core/dps
{ID}
您要更新之實體的ID。
rule1234

要求

curl -X PATCH 'https://platform.adobe.io/data/core/dps/offer-rules/rule1234' \
-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": "[UPDATED] Test Offer Rule DPS",
    "description": "Offer Rule description",
    "exdRule": true,
    "condition": {
        "type": "PQL",
        "format": "pql/text",
        "value": "homeAddress.stateProvince.equals(\"CA\", false) and (select var1 from xEvent where var1.eventType.equals(\"purchase\", true) and (var1.commerce.order.priceTotal = 1000.0 and var1.commerce.order.currencyCode.equals(\"USD\", false)))"
    },
    "definedOn": {
        "": {
            "schema": {
                "altId": "_xdm.context.profile",
                "version": "1"
            },
            "referencePaths": [
                "homeAddress.stateProvince"
            ]
        },
        "xEvent": {
            "schema": {
                "altId": "_xdm.context.experienceevent",
                "version": "1"
            },
            "referencePaths": [
                "eventType",
                "commerce.order.priceTotal",
                "commerce.order.currencyCode"
            ]
        }
    }
}'
參數
說明
value
您想要用來更新引數的新值。
path
要更新之引數的路徑。
op
用於定義更新連線所需動作的操作呼叫。 作業包括: add、replace、remove、copy和test。

回應

成功的回應會傳回適用性規則的更新詳細資料,包括ID。

{
    "etag": 2,
    "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
journey-optimizer-help