決定ルールのリスト

決定ルールは、パーソナライズされたオファーに追加される制約で、実施要件を決定するためにプロファイルに適用されます。Offer Library API に対して単一の GET リクエストを実行することで、コンテナ内の既存の決定ルールのリストを表示できます。

API 形式

GET /{ENDPOINT_PATH}/offer-rules?{QUERY_PARAMS}
パラメーター 説明
{ENDPOINT_PATH} 永続化 API のエンドポイントパス。 https://platform.adobe.io/data/core/dps
{QUERY_PARAMS} 結果をフィルターするオプションのクエリパラメーター。 limit=2

クエリパラメーターの使用

リソースのリストを表示する際に、クエリパラメーターを使用してページを作成し、結果をフィルターできます。

ページング

ページングに最も一般的なクエリパラメーターは次のとおりです。

パラメーター 説明
property オプションのプロパティフィルターは次のとおりです。
  • プロパティは AND 演算でグループ化されます。

    — パラメーターは、次のように繰り返し使用できます。 property=<property-expr>[&property=<property-expr2>…] またはプロパティ=<property-expr1>[&<property-expr2>…]

    — プロパティの式は形式です [ !]field[op] 値、オプインあり [==,!=,'<=',>=,<,>,~],正規表現のサポート
property=name!=abc&property=id~.*1234.*&property=description equivalent with property=name!=abc,id~.*1234.*,description.
orderBy 特定のプロパティで結果を並べ替えます。名前の前に — を追加すると (orderby=-name)、降順 (Z ~ A) で項目が名前で並べ替えられます。 パス式は、ドット区切りのパスの形式です。 このパラメーターは、次のように繰り返すことができます。 orderby=field1[,-fields2,field3,...] orderby=id-name
limit 返されるエンティティの数を制限します。 limit=5

リクエスト

curl -X GET 'https://platform.adobe.io/data/core/dps/offer-rules?limit=2' \
-H 'Accept: *,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}'

応答

正常な応答は、アクセス権のある判定ルールのリストを返します。

{
     "results": [
        {
            "created": "2022-09-16T18:59:53.651+00:00",
            "modified": "2022-09-16T18:59:53.651+00:00",
            "etag": 1,
            "schemas": [
                "https://ns.adobe.com/experience/offer-management/eligibility-rule;version=0.3"
            ],
            "createdBy": "{CREATED_BY}",
            "lastModifiedBy": "{MODIFIED_BY}",
            "id": "offerRule1234",
            "name": "Californians with one or more purchases greater than $1000",
            "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)))"
                 }
        },
        {
            "created": "2023-03-06T15:11:42.178+00:00",
            "modified": "2023-03-06T15:11:42.178+00:00",
            "etag": 1,
            "schemas": [
                "https://ns.adobe.com/experience/offer-management/eligibility-rule;version=0.3"
            ],
            "createdBy": "{CREATED_BY}",
            "lastModifiedBy": "{MODIFIED_BY}",
            "id": "offerRule5678",
            "name": "People born after 1981",
            "description": "Persons with the birth date after 1981",
            "condition": {
                "type": "PQL",
                "format": "pql/text",
                "value": "person.birthDate occurs after date(1981, 1, 1)"
            }
        }
    ],
    "count": 2,
    "total": 25,
    "_links": {
        "self": {
            "href": "/offer-rules?href={SELF_HREF}&limit=2",
            "type": "application/json"
        },
        "next": {
            "href": "/offer-rules?href={NEXT_HREF}&limit=2",
            "type": "application/json"
        }
    }
}

このページ