建立決定

您可以通過向POST Offer Library API,同時提供容器ID。

接受和內容類型標題

下表顯示了組成 內容類型接受 請求標題中的欄位:

標題名稱
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-activity;version=0.5"

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-activity;version=0.5"' \
  -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 '{
      "_instance": {
          "xdm:name": "Test API",
          "xdm:startDate": "2022-01-20T16:00:00Z",
          "xdm:endDate": "2022-01-27T16:00:00Z",
          "xdm:status": "live",
          "xdm:criteria": [
              {
                  "xdm:placements": [
                      "xcore:offer-placement:1457f9322f005194"
                  ],
                  "xdm:optionSelection": {
                      "xdm:filter": "xcore:offer-filter:1457f93227d0b6f0"
                  }
              }
          ],
          "xdm:fallback": "xcore:fallback-offer:13c259399d8bf013"
      },
      "_links": {}
  }'

回應

成功的響應返回有關新建立決策的資訊,包括其唯一實例ID和位置 @id。 您可以在後續步驟中使用實例ID來更新或刪除您的決定。

{
    "instanceId": "f88c9be0-1245-11eb-8622-b77b60702882",
    "@id": "xcore:offer-activity:124b79dc3ce2d720",
    "repo:etag": 1,
    "repo:createdDate": "2020-10-19T20:02:09.694067Z",
    "repo:lastModifiedDate": "2020-10-19T20:02:09.694067Z",
    "repo:createdBy": "{CREATED_BY}",
    "repo:lastModifiedBy": "{MODIFIED_BY}",
    "repo:createdByClientId": "{CREATED_CLIENT_ID}",
    "repo:lastModifiedByClientId": "{MODIFIED_CLIENT_ID}"
}

本頁內容