智慧行銷活動

智慧行銷活動端點參考(資產)

行銷活動端點參考(潛在客戶)

Marketo提供了一組REST API,可用於對智慧行銷活動執行操作。 這些API遵循資產API的標準介面模式,提供查詢、建立、複製和刪除選項。 此外,您也可以排程批次行銷活動或請求觸發行銷活動,以管理智慧行銷活動的執行。

查詢

查詢智慧型行銷活動會遵循的標準查詢型別(依識別碼依名稱瀏覽)。

依Id

依ID取得Smart Campaign端點將單一Smart Campaign id當做路徑引數,並傳回單一Smart Campaign記錄。

GET /rest/asset/v1/smartCampaign/{id}.json
{
    "success": true,
    "errors": [],
    "requestId": "7883#169838a32f0",
    "warnings": [],
    "result": [
        {
            "id": 1001,
            "name": "Process Bounced Emails",
            "description": "System smart campaign for processing bounced email events",
            "createdAt": "2016-09-10T23:16:19Z+0000",
            "updatedAt": "2016-09-10T23:16:19Z+0000",
            "status": "Never Run",
            "type": "batch",
            "isSystem": false,
            "isActive": false,
            "isRequestable": false,
            "isCommunicationLimitEnabled": false,
            "recurrence": {
                "weekdayOnly": false
            },
            "qualificationRuleType": "once",
            "workspace": "Default",
            "smartListId": 1001,
            "flowId": 1001,
            "computedUrl": "https://app-sjqe.marketo.com/#SC1001A1"
        }
    ]
}

使用此端點,result陣列的第一個位置將一律有單一記錄。

依名稱

依名稱取得Smart Campaign端點將單一Smart Campaign name作為引數,並傳回單一Smart Campaign記錄。

GET /rest/asset/v1/smartCampaign/byName.json?name=Test Trigger Campaign
{
    "success": true,
    "errors": [],
    "requestId": "14494#16c886ffa44",
    "warnings": [],
    "result": [
        {
            "id": 1069,
            "name": "Test Trigger Campaign",
            "description": "",
            "createdAt": "2018-02-16T01:34:39Z+0000",
            "updatedAt": "2019-08-13T00:45:21Z+0000",
            "folder": {
                "id": 327,
                "type": "Folder"
            },
            "status": "Inactive",
            "type": "trigger",
            "isSystem": false,
            "isActive": false,
            "isRequestable": false,
            "isCommunicationLimitEnabled": false,
            "recurrence": {
                "weekdayOnly": false
            },
            "qualificationRuleType": "once",
            "workspace": "Default",
            "smartListId": 2747,
            "flowId": 1088,
            "computedUrl": "https://app-sjqe.marketo.com/#SC1069A1"
        }
    ]
}

使用此端點,result陣列的第一個位置將一律有單一記錄。

瀏覽

Get Smart Campaigns端點的運作方式與其他資產API瀏覽端點類似,並可允許數個選用查詢引數來指定篩選條件。

earliestUpdatedAtlatestUpdatedAt引數接受ISO-8601格式的datetimes (不含毫秒)。 如果兩者皆已設定,則earliestUpdatedAt必須在latestUpdatedAt之前。

folder引數指定要瀏覽的父資料夾。 格式為包含idtype屬性的JSON區塊。

maxReturn引數是整數,指定要傳回的專案數目上限。 預設值為20。 最大值為200。

offset引數是整數,指定從何處開始擷取專案。 可與maxReturn搭配使用。 預設值為0。

isActive引數是布林值,指定只傳回作用中的觸發促銷活動。

GET /rest/asset/v1/smartCampaigns.json?earliestUpdatedAt=2016-09-10T23:15:00-00:00&latestUpdatedAt=2016-09-10T23:17:00-00:00
{
    "success": true,
    "errors": [],
    "requestId": "626#16983a92965",
    "warnings": [],
    "result": [
        {
            "id": 1001,
            "name": "Process Bounced Emails",
            "description": "System smart campaign for processing bounced email events",
            "createdAt": "2016-09-10T23:16:19Z+0000",
            "updatedAt": "2016-09-10T23:16:19Z+0000",
            "status": "Never Run",
            "type": "batch",
            "isSystem": false,
            "isActive": false,
            "isRequestable": false,
            "isCommunicationLimitEnabled": false,
            "recurrence": {
                "weekdayOnly": false
            },
            "qualificationRuleType": "once",
            "workspace": "Default",
            "smartListId": 1001,
            "flowId": 1001,
            "computedUrl": "https://app-sjqe.marketo.com/#SC1001A1"
        },
        {
            "id": 1002,
            "name": "Process Unsubscribes",
            "description": "System smart campaign for processing unsubscribe events",
            "createdAt": "2016-09-10T23:16:19Z+0000",
            "updatedAt": "2016-09-10T23:16:19Z+0000",
            "status": "Never Run",
            "type": "batch",
            "isSystem": false,
            "isActive": false,
            "isRequestable": false,
            "isCommunicationLimitEnabled": false,
            "recurrence": {
                "weekdayOnly": false
            },
            "qualificationRuleType": "once",
            "workspace": "Default",
            "smartListId": 1002,
            "flowId": 1002,
            "computedUrl": "https://app-sjqe.marketo.com/#SC1002A1"
        }
    ]
}

使用此端點,result陣列中將有一或多個記錄。

建立

建立Smart Campaign端點是使用具有兩個必要引數的application/x-www-form-urlencoded POST執行。 name引數指定要建立的智慧行銷活動的名稱。 folder引數會指定智慧行銷活動建立所在的父資料夾。 格式為包含idtype屬性的JSON區塊。

您可以選擇使用description引數(最多2,000個字元)描述智慧行銷活動。

POST /rest/asset/v1/smartCampaigns.json
Content-Type: application/x-www-form-urlencoded
name=Smart Campaign 02&folder={"type": "folder","id": 640}&description=This is a smart campaign creation test.
{
    "success": true,
    "errors": [],
    "requestId": "25bc#16c9138f148",
    "warnings": [],
    "result": [
        {
            "id": 1076,
            "name": "Smart Campaign 02",
            "description": "This is a smart campaign creation test.",
            "createdAt": "2019-08-14T17:42:04Z+0000",
            "updatedAt": "2019-08-14T17:42:04Z+0000",
            "folder": {
                "id": 640,
                "type": "Folder"
            },
            "status": "Never Run",
            "type": "batch",
            "isSystem": false,
            "isActive": false,
            "isRequestable": false,
            "isCommunicationLimitEnabled": true,
            "recurrence": {
                "weekdayOnly": false
            },
            "qualificationRuleType": "once",
            "workspace": "Default",
            "smartListId": 5132,
            "flowId": 1095,
            "computedUrl": "https://app-sjqe.marketo.com/#SC1076A1"
        }
    ]
}

更新

Update Smart Campaign端點使用application/x-www-form-urlencoded POST執行。 它以單一智慧行銷活動id作為路徑引數。 您可以使用name引數來更新智慧行銷活動的名稱,或使用description引數來更新智慧行銷活動的說明。

POST /rest/asset/v1/smartCampaign/{id}.json
Content-Type: application/x-www-form-urlencoded
name=Smart Campaign 02 Update&description=This is a smart campaign update test.
{
    "success": true,
    "errors": [],
    "requestId": "14b6a#16c924b992f",
    "warnings": [],
    "result": [
        {
            "id": 1076,
            "name": "Smart Campaign 02 Update",
            "description": "This is a smart campaign update test.",
            "createdAt": "2019-08-14T17:42:04Z+0000",
            "updatedAt": "2019-08-14T22:42:04Z+0000",
            "folder": {
                "id": 640,
                "type": "Folder"
            },
            "status": "Never Run",
            "type": "batch",
            "isSystem": false,
            "isActive": false,
            "isRequestable": false,
            "isCommunicationLimitEnabled": true,
            "recurrence": {
                "weekdayOnly": false
            },
            "qualificationRuleType": "once",
            "workspace": "Default",
            "smartListId": 5132,
            "flowId": 1095,
            "computedUrl": "https://app-sjqe.marketo.com/#SC1076A1"
        }
    ]
}

原地複製

仿製智慧型行銷活動端點是使用具有三個必要引數的application/x-www-form-urlencoded POST執行。 它需要指定要複製的智慧行銷活動的id引數、指定新智慧行銷活動名稱的name引數,以及指定建立新智慧行銷活動的父資料夾的folder引數。 格式為包含idtype屬性的JSON區塊。

您可以選擇使用description引數(最多2,000個字元)描述智慧行銷活動。

POST /rest/asset/v1/smartCampaign/{id}/clone.json
Content-Type: application/x-www-form-urlencoded
name=Test Trigger Campaign Clone&folder={"type": "folder","id": 640}&description=This is a smart campaign clone test.
{
    "success": true,
    "errors": [],
    "requestId": "681d#16c9339499b",
    "warnings": [],
    "result": [
        {
            "id": 1077,
            "name": "Test Trigger Campaign Clone",
            "description": "This is a smart campaign clone test.",
            "createdAt": "2019-08-15T03:01:41Z+0000",
            "updatedAt": "2019-08-15T03:01:41Z+0000",
            "folder": {
                "id": 640,
                "type": "Folder"
            },
            "status": "Inactive",
            "type": "trigger",
            "isSystem": false,
            "isActive": false,
            "isRequestable": false,
            "isCommunicationLimitEnabled": false,
            "recurrence": {
                "weekdayOnly": false
            },
            "qualificationRuleType": "once",
            "workspace": "Default",
            "smartListId": 5135,
            "flowId": 1096,
            "computedUrl": "https://app-sjqe.marketo.com/#SC1077A1"
        }
    ]
}

刪除

刪除Smart Campaign端點會將單一Smart Campaign id當做路徑引數。

POST /rest/asset/v1/smartCampaign/{id}/delete.json
{
    "success": true,
    "errors": [],
    "requestId": "d757#16c934216ac",
    "warnings": [],
    "result": [
        {
            "id": 1077
        }
    ]
}

批次

批次智慧型行銷活動會在特定時間啟動,並一次影響一組特定的銷售機會。

排程

使用排程行銷活動端點來排程要立即執行或在未來日期執行的批次行銷活動。 行銷活動id是必要的路徑引數。 選用引數是tokensrunAtcloneToProgram,它們會在要求內文中以application/json形式傳遞。

Token陣列引數是My Token的陣列,可覆寫現有的程式Token。 行銷活動執行後,會捨棄代號。  每個權杖陣列專案都包含名稱/值配對。 權杖的名稱必須格式化為"{{my.name}}"。

runAt日期時間引數會指定執行促銷活動的時間。 如果未指定,行銷活動將在呼叫端點後5分鐘執行。 日期時間值在未來的兩年內不得超過。

透過此API排程的行銷活動在執行之前一律至少要等待五分鐘。

cloneToProgram字串引數包含產生程式的名稱。  設定後,促銷活動、上層方案及其所有資產都會以產生的新名稱建立。 父方案已複製,並將排程新建立的行銷活動。 產生的程式會在父項下建立。 包含程式碼片段、推播通知、應用程式內訊息、靜態清單、報表和社交資產的程式可能無法以這種方式複製。 使用時,此端點限制每天最多20次呼叫。 復製程式端點是建議的替代方案。

POST /rest/v1/campaigns/{id}/schedule.json
{
   "input":
      {
         "runAt": "2018-03-28T18:05:00+0000",
         "tokens": [
            {
               "name": "{{my.message}}",
               "value": "Updated message"
            },
            {
               "name": "{{my.other token}}",
               "value": "Value for other token"
            }
          ]
      }
}
{
    "requestId": "52b#161d90e1743",
    "result": [
        {
            "id": 3713
        }
    ],
    "success": true
}

觸發程序

觸發智慧型行銷活動會根據觸發的事件而一次影響一個人。

請求

使用要求行銷活動端點將一組銷售機會傳遞至觸發行銷活動,以透過行銷活動流程執行。 行銷活動必須有一個以「網站服務API」作為來源的「已要求行銷活動」觸發器。

此端點需要行銷活動id做為路徑引數,以及包含潛在客戶ID的leads整數陣列引數。 每次呼叫最多允許100個銷售機會。

tokens陣列引數可選擇性用來覆寫促銷活動上層方案的本機My Token。 tokens接受最多100個權杖。 每個tokens陣列專案都包含一個名稱/值組。 權杖的名稱必須格式化為"{{my.name}}"。 如果您使用新增系統權杖作為電子郵件方法中的連結來新增「viewAsWebPageLink」系統權杖,則無法使用tokens覆寫它。 改為使用將檢視新增為網頁連結至電子郵件方法,可讓您使用tokens覆寫「viewAsWebPageLink」。

leadstokens引數是以application/json的形式傳入要求內文中。

POST /rest/v1/campaigns/{id}/trigger.json
{
   "input":
      {
         "leads" : [
            {
               "id" : 318592
            },
            {
               "id" : 318593
            }
         ],
         "tokens" : [
            {
               "name": "{{my.message}}",
               "value": "Updated message"
            },
            {
               "name": "{{my.other token}}",
               "value": "Value for other token"
            }
         ]
      }
}
{
    "requestId": "9e01#161d922f1aa",
    "result": [
        {
            "id": 3712
        }
    ],
    "success": true
}

啟動

啟動Smart Campaign端點很簡單。 需要id路徑引數。 若要成功啟用,行銷活動必須符合下列條件:

  • 必須停用
  • 必須至少有一個觸發器和一個流程步驟
  • 必須有沒有錯誤的觸發器、篩選器和流程步驟
POST /rest/asset/v1/smartCampaign/{id}/activate.json
{
    "success": true,
    "errors": [],
    "requestId": "a33a#161d9c0dcf3",
    "result": [
        {
            "id": 1069
        }
    ]
}

停用

停用智慧行銷活動簡單明瞭。 需要id路徑引數。 若要成功停用,必須啟動行銷活動。

POST /rest/asset/v1/smartCampaign/{id}/deactivate.json
{
    "success": true,
    "errors": [],
    "requestId": "6228#161d9c29fbf",
    "result": [
        {
            "id": 1069
        }
    ]
}
recommendation-more-help
bb269a6d-047a-4bf7-9acd-23ad9a63dc59