列出决策

上次更新: 2023-10-18
  • 创建对象:
  • Experienced
    Developer

决策包含通知优惠选择的逻辑。

您可以通过对容器执行单个GET请求,查看容器中所有决策的列表。 Offer Library API。

API格式

GET /{ENDPOINT_PATH}/{CONTAINER_ID}/queries/core/search?schema={SCHEMA_ACTIVITIES}&{QUERY_PARAMS}
参数 描述 示例
{ENDPOINT_PATH} 存储库API的端点路径。 https://platform.adobe.io/data/core/xcore/
{CONTAINER_ID} 决策所在的容器。 e0bd8463-0913-4ca1-bd84-6309134ca1f6
{SCHEMA_ACTIVITIES} 定义与决策关联的架构。 https://ns.adobe.com/experience/offer-management/offer-activity;version=0.5
{QUERY_PARAMS} 用于筛选结果的可选查询参数。 limit=2

请求

curl -X GET \
  'https://platform.adobe.io/data/core/xcore/e0bd8463-0913-4ca1-bd84-6309134ca1f6/queries/core/search?schema=https://ns.adobe.com/experience/offer-management/offer-activity;version=0.5&limit=2' \
  -H 'Accept: *,application/vnd.adobe.platform.xcore.hal+json; schema="https://ns.adobe.com/experience/xcore/hal/results"' \
-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}'
参数 描述 示例
q 在选定字段中搜索的可选查询字符串。 查询字符串应当小写,并且可以用双引号括起来,以防止对其进行标记化并对特殊字符进行转义。 字符 + - = && || > < ! ( ) { } [ ] ^ \" ~ * ? : \ / 具有特殊含义,在查询字符串中出现时应使用反斜杠进行转义。 default
qop 对q查询字符串参数中的值应用AND或OR运算符。 AND / OR
field 将搜索限制到的可选字段列表。 此参数可重复,如下所示:field=field1[,字段=字段2,…] 和(路径表达式采用点分隔路径形式,如_instance.xdm:name) _instance.xdm:name
orderBy 按特定属性对结果进行排序。 添加 - 在标题之前(orderby=-title)将按标题降序对项目排序(Z-A)。 -repo:createdDate
limit 限制返回的决策数。 limit=5

响应

成功的响应会返回决策列表,这些决策包含在您有权访问的容器中。

{
    "results": [
        {
            "created": "2022-07-05T09:02:02.835+00:00",
            "modified": "2022-08-16T21:40:58.573+00:00",
            "etag": 12,
            "schemas": [
                "https://ns.adobe.com/experience/offer-management/offer-activity;version=0.8"
            ],
            "createdBy": "{CREATED_BY}",
            "lastModifiedBy": "{MODIFIED_BY}",
            "id": "offerDecision1234",
            "name": "Test Decision One",
            "status": "live",
            "startDate": "2022-05-18T00:09:57.706+00:00",
            "endDate": "2032-08-13T21:40:58.235+00:00",
            "fallback": "fallbackOffer1234",
            "criteria": [
                {
                    "placements": [
                        "offerPlacement1234",
                        "offerPlacement5678"
                    ],
                    "rank": {
                        "priority": 0,
                        "order": {
                            "orderEvaluationType": "ranking-strategy",
                            "rankingStrategy": "123456789123"
                        }
                    },
                    "profileConstraint": {
                        "profileConstraintType": "none"
                    },
                    "optionSelection": {
                        "filter": "offerCollection1234"
                    }
                }
            ]
        },
        {
            "created": "2022-09-05T14:12:13.773+00:00",
            "modified": "2022-09-05T14:12:13.773+00:00",
            "etag": 1,
            "schemas": [
                "https://ns.adobe.com/experience/offer-management/offer-activity;version=0.8"
            ],
            "createdBy": "{CREATED_BY}",
            "lastModifiedBy": "{MODIFIED_BY}",
            "id": "offerDecision5678",
            "name": "Test Decision Two",
            "status": "live",
            "startDate": "2022-08-31T21:00:00.000+00:00",
            "endDate": "2023-02-03T22:00:00.000+00:00",
            "fallback": "fallbackOffer5678",
            "criteria": [
                {
                    "placements": [
                        "offerPlacement1234"
                    ],
                    "rank": {
                        "priority": 2
                    },
                    "optionSelection": {
                        "filter": "offerCollection5678"
                    }
                },
                {
                    "placements": [
                        "offerPlacement5678"
                    ],
                    "rank": {
                        "priority": 1
                    },
                    "optionSelection": {
                        "filter": "offerCollection1234"
                    }
                }
            ]
        }
    ],
    "count": 2,
    "total": 21,
    "_links": {
        "self": {
            "href": "/offer-decisions?href={SELF_HREF}&limit=2",
            "type": "application/json"
        },
        "next": {
            "href": "/offer-decisions?href={NEXT_HREF}&limit=2",
            "type": "application/json"
        }
    }
}

在此页面上