行銷動作端點

在Adobe Experience Platform資料控管的內容中,行銷動作是指 Experience Platform 資料取用者需要檢查資料使用原則是否違規。

您可以使用管理組織的行銷動作 /marketingActions 原則服務API中的端點。

快速入門

本指南中使用的API端點屬於 Policy Service API. 在繼續之前,請檢閱 快速入門手冊 如需相關檔案的連結,請參閱本檔案範例API呼叫的指南,以及有關成功呼叫任何專案所需標題的重要資訊 Experience Platform API。

擷取行銷動作清單 list

您可以透過向以下發出GET請求,擷取核心或自訂行銷動作清單: /marketingActions/core/marketingActions/custom,依序輸入。

API格式

GET /marketingActions/core
GET /marketingActions/custom

要求

下列請求會擷取貴組織維護的自訂行銷動作清單。

curl -X GET \
  https://platform.adobe.io/data/foundation/dulepolicy/marketingActions/custom \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}'

回應

成功的回應會傳回每個已擷取行銷動作的詳細資料,包括其 namehref. 此 href 值是用來識別行銷動作,當 建立資料使用原則.

{
    "_page": {
        "count": 2
    },
    "_links": {
        "page": {
            "href": "https://platform.adobe.io/marketingActions/custom?{?limit,start,property}",
            "templated": true
        }
    },
    "children": [
        {
            "name": "sampleMarketingAction",
            "description": "Marketing Action description.",
            "imsOrg": "{ORG_ID}",
            "created": 1550714012088,
            "createdClient": "string",
            "createdUser": "string",
            "updated": 1550714012088,
            "updatedClient": "string",
            "updatedUser": "string",
            "_links": {
                "self": {
                    "href": "https://platform.adobe.io/data/foundation/dulepolicy/marketingActions/custom/sampleMarketingAction"
                }
            }
        },
        {
            "name": "newMarketingAction",
            "description": "Another marketing action.",
            "imsOrg": "{ORG_ID}",
            "created": 1550793833224,
            "createdClient": "string",
            "createdUser": "string",
            "updated": 1550793833224,
            "updatedClient": "string",
            "updatedUser": "string",
            "_links": {
                "self": {
                    "href": "https://platform.adobe.io/data/foundation/dulepolicy/marketingActions/custom/newMarketingAction"
                }
            }
        }
    ]
}
屬性
說明
_page.count
傳回的行銷動作總數。
children
一個物件陣列,其中包含已擷取行銷動作的詳細資訊。
name
行銷動作的名稱,在下列情況下當作其唯一識別碼: 查詢特定行銷動作.
_links.self.href
行銷動作的URI參考,可用來完成 marketingActionsRefs 陣列時間 建立資料使用原則.

查詢特定行銷動作 lookup

您可以包含行銷動作的,以查閱特定行銷動作的詳細資料 name 屬性位於GET請求的路徑中。

API格式

GET /marketingActions/core/{MARKETING_ACTION_NAME}
GET /marketingActions/custom/{MARKETING_ACTION_NAME}
參數
說明
{MARKETING_ACTION_NAME}
name 您要查閱之行銷動作的屬性。

要求

以下請求會擷取自訂行銷動作,並命名為 combineData.

curl -X GET \
  https://platform.adobe.io/data/foundation/dulepolicy/marketingActions/custom/combineData \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}'

回應

回應物件包含行銷動作的詳細資訊,包括路徑(_links.self.href)時參考行銷動作所需 定義資料使用原則 (marketingActionsRefs)。

{
    "name": "combineData",
    "description": "Combine multiple data sources together.",
    "imsOrg": "{ORG_ID}",
    "created": 1550793805590,
    "createdClient": "string",
    "createdUser": "string",
    "updated": 1550793805590,
    "updatedClient": "string",
    "updatedUser": "string",
    "_links": {
        "self": {
            "href": "https://platform.adobe.io/data/foundation/dulepolicy/marketingActions/custom/combineData"
        }
    }
}

建立或更新自訂行銷動作 create-update

您可以在PUT請求的路徑中包含行銷動作的現有或預期名稱,以建立新的自訂行銷動作或更新現有行銷動作。

API格式

PUT /marketingActions/custom/{MARKETING_ACTION_NAME}
參數
說明
{MARKETING_ACTION_NAME}
要建立或更新之行銷動作的名稱。 如果系統中已存在具有所提供名稱的行銷動作,則會更新該行銷動作。 如果不存在,則會針對提供的名稱建立新的行銷動作。

要求

以下請求會建立新的行銷動作,命名為 crossSiteTargeting,前提是系統中不存在相同名稱的行銷動作。 如果 crossSiteTargeting 行銷動作確實存在,此呼叫會根據裝載中提供的屬性更新行銷動作。

curl -X PUT \
  https://platform.adobe.io/data/foundation/dulepolicy/marketingActions/custom/crossSiteTargeting \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
        "name": "crossSiteTargeting",
        "description": "Perform targeting on information obtained across multiple web sites."
      }'
屬性
說明
name
要建立或更新之行銷動作的名稱。

重要:此屬性必須與 {MARKETING_ACTION_NAME} 路徑中,否則會發生HTTP 400 (錯誤請求)錯誤。 換言之,建立行銷動作後,其 name 屬性無法變更。
description
選用的說明,可提供行銷動作的進一步內容。

回應

成功的回應會傳回行銷動作的詳細資料。 如果更新了現有的行銷動作,回應會傳回HTTP狀態200 (確定)。 如果建立了新的行銷動作,回應會傳回HTTP狀態201 (已建立)。

{
    "name": "crossSiteTargeting",
    "description": "Perform targeting on information obtained across multiple web sites.",
    "imsOrg": "{ORG_ID}",
    "created": 1550713341915,
    "createdClient": "string",
    "createdUser": "string",
    "updated": 1550713856390,
    "updatedClient": "string",
    "updatedUser": "string",
    "_links": {
        "self": {
            "href": "https://platform.adobe.io/data/foundation/dulepolicy/marketingActions/custom/crossSiteTargeting"
        }
    }
}

刪除自訂行銷動作 delete

您可以在DELETE請求的路徑中包含自訂行銷動作的名稱,以刪除該動作。

NOTE
無法刪除現有原則參照的行銷動作。 嘗試刪除其中一個行銷動作將導致HTTP 400 (錯誤請求)錯誤以及包含參考行銷動作之所有原則ID的訊息。

API格式

DELETE /marketingActions/custom/{MARKETING_ACTION_NAME}
參數
說明
{MARKETING_ACTION_NAME}
您要刪除的行銷動作名稱。

要求

curl -X DELETE \
  https://platform.adobe.io/data/foundation/dulepolicy/marketingActions/custom/crossSiteTargeting \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}'

回應

成功的回應會傳回HTTP狀態200 (確定),並帶有空白回應內文。

您可以嘗試確認刪除 查詢行銷動作. 如果行銷動作已從系統中移除,您應該會收到HTTP 404 (找不到)錯誤。

recommendation-more-help
834e0cae-2761-454a-be4d-62f0fd4b4456