列出后备优惠 list-fallback-offers

如果客户不符合其他优惠的条件,则会向客户发送后备优惠。 创建后备优惠的步骤包括创建一个或多个呈现,如创建优惠时。

您可以通过对以下对象执行单个GET请求,查看所有备用选件的列表: Offer Library API。

API格式

GET /{ENDPOINT_PATH}/offers?offer-type=fallback&{QUERY_PARAMS}
参数
描述
示例
{ENDPOINT_PATH}
持久性API的端点路径。
https://platform.adobe.io/data/core/dps
{QUERY_PARAMS}
用于筛选结果的可选查询参数。
limit=2

请求

curl -X GET 'https://platform.adobe.io/data/core/dps/offers?offer-type=fallback&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}'

使用查询参数 using-query-parameters

在列出资源时,您可以使用查询参数来分页并筛选结果。

分页 paging

分页最常见的查询参数包括:

参数
描述
示例
property

可选的属性过滤器:

  • 这些属性按AND操作进行分组。
  • 参数可以重复,如下所示:属性={PROPERTY_EXPR}[属性(&P)={PROPERTY_EXPR2}…] 或属性={PROPERTY_EXPR1}[,{PROPERTY_EXPR2}…]
  • 属性表达式采用格式 [ !]field[op]value,替换为 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

响应

成功的响应将返回您有权访问的备用选件列表。

{
      "results": [
        {
            "created": "2023-06-08T14:04:41.011+00:00",
            "modified": "2023-06-08T14:04:41.011+00:00",
            "etag": 1,
            "schemas": [
                "https://ns.adobe.com/experience/offer-management/fallback-offer;version=0.8"
            ],
            "createdBy": "{CREATED_BY}",
            "lastModifiedBy": "{MODIFIED_BY}",
            "id": "fallbackOffer1234",
            "name": "Fallback Offer Web",
            "description": "Fallback Offer Web Description",
            "status": "draft",
            "representations": [
                {
                    "channel": "https://ns.adobe.com/xdm/channel-types/web",
                    "placement": "offerPlacement5678",
                    "components": [
                        {
                            "type": "imagelink",
                            "format": "image/png",
                            "deliveryURL": "https://mysite.com"
                        }
                    ]
                }
            ]
        },
        {
            "created": "2022-10-07T11:23:55.885+00:00",
            "modified": "2022-10-07T11:23:55.885+00:00",
            "etag": 1,
            "schemas": [
                "https://ns.adobe.com/experience/offer-management/fallback-offer;version=0.7"
            ],
            "createdBy": "{CREATED_BY}",
            "lastModifiedBy": "{MODIFIED_BY}",
            "id": "fallbackOffer5678",
            "name": "Fallback Offer email",
            "status": "approved",
            "representations": [
                {
                    "channel": "https://ns.adobe.com/xdm/channel-types/email",
                    "placement": "offerPlacement1234",
                    "components": [
                        {
                            "type": "component-text",
                            "format": "text/template",
                            "content": "Get free shipping!"
                        }
                    ]
                }
            ],
            "labels": [
                "core/C1"
            ]
        }
    ],
    "count": 2,
    "total": 3,
    "_links": {
        "self": {
            "href": "/offers?offer-type=fallback&href={SELF_HREF}&limit=2",
            "type": "application/json"
        },
        "next": {
            "href": "/offers?offer-type=fallback&href={NEXT_HREF}&limit=2",
            "type": "application/json"
        }
    }
}
recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76