建立集合

集合是優惠方案的子集,根據行銷人員定義的預先定義條件,例如優惠方案類別。

您可以透過向以下傳送POST請求來建立集合: Offer Library API,同時提供容器ID。

Accept和Content-Type標題

下表顯示包含 Content-TypeAccept 請求標頭中的欄位:

標頭名稱
Accept application/vnd.adobe.platform.xcore.xdm.receipt+json; version=1
Content-Type application/schema-instance+json; version=1; schema="https://ns.adobe.com/experience/offer-management/offer-filter;version=0.1"

API格式

POST /{ENDPOINT_PATH}/{CONTAINER_ID}/instances
參數 說明 範例
{ENDPOINT_PATH} 存放庫API的端點路徑。 https://platform.adobe.io/data/core/xcore/
{CONTAINER_ID} 集合所在的容器。 e0bd8463-0913-4ca1-bd84-6309134ca1f6

要求

curl -X POST \
  'https://platform.adobe.io/data/core/xcore/e0bd8463-0913-4ca1-bd84-6309134ca1f6/instances' \
  -H 'Accept: application/vnd.adobe.platform.xcore.xdm.receipt+json; version=1' \
  -H 'Content-Type: application/schema-instance+json; version=1;  schema="https://ns.adobe.com/experience/offer-management/offer-filter;version=0.1"' \
  -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 '{
        "xdm:name": "Offer Collection 1",
        "xdm:filterType": "anyTags",
        "xdm:ids": [
            "xcore:tag:124e147572cd7866"
        ]
    }'

回應

成功的回應會傳回關於新建立集合的資訊,包括其唯一的執行個體ID和位置 @id. 您可以在稍後的步驟中使用執行個體ID來更新或刪除您的集合。 您可以使用唯一集合 @id 在稍後的教學課程中建立決定。

{
    "instanceId": "0bf31c20-13f1-11eb-a752-e58fd7dc4cb3",
    "@id": "xcore:offer-filter:124e3594ce8b4930",
    "repo:etag": 1,
    "repo:createdDate": "2020-10-21T22:59:17.345797Z",
    "repo:lastModifiedDate": "2020-10-21T22:59:17.345797Z",
    "repo:createdBy": "{CREATED_BY}",
    "repo:lastModifiedBy": "{MODIFIED_BY}",
    "repo:createdByClientId": "{CREATED_CLIENT_ID}",
    "repo:lastModifiedByClientId": "{MODIFIED_CLIENT_ID}"
}

本頁內容