計畫

程式端點參考

方案是Marketo行銷活動的核心組織元件。 他們可以成為大多數資產型別的母公司,並可在個別行銷方案的環境中追蹤成員資格和潛在客戶的成功。 程式可以是LP、電子郵件範本和檔案以外所有記錄型別的父系。

計畫型別

Marketo中有五種核心型別的計畫:

  • 預設
  • 事件
  • 含網路研討會的事件
  • 參與
  • 電子郵件

參與計畫可能是其他計畫型別的父級,而預設、事件和帶網路研討會的事件可能只是電子郵件計畫的父級。

程式一律有管道。程式從建立管道衍生出可能的設定程式成員狀態,可使用「取得管道API」擷取該管道。 一個方案也可能有一組相關的標籤。 標籤是可自訂的欄位,可設定為任何指定型別的計畫的選用或必要欄位,這些計畫將從Marketo管理員中設定的清單選取值。

查詢

程式遵循資產查詢的標準模式,並提供依標籤型別和值查詢的額外選項。 可用的標籤和值可以使用取得標籤型別擷取。

依Id

依ID取得程式端點需要id路徑引數。

程式識別碼可從UI中程式的URL取得,其中該URL類似於https://app-\*\*\*.marketo.com/#PG1001A1。 在此URL中,id為1001。 它永遠介於URL中的第一組字母和第二組字母之間。

GET /rest/asset/v1/program/{id}.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "948f#14db037ec71",
    "result": [
        {
            "id": 1107,
            "name": "AAA2QueryProgramName",
            "description": "AssetAPI: getProgram tests",
            "createdAt": "2015-05-21T22:45:13Z+0000",
            "updatedAt": "2015-05-21T22:45:13Z+0000",
            "url": "https://app-devlocal1.marketo.com/#PG1107A1",
            "type": "Default",
            "channel": "Online Advertising",
            "folder": {
                "type": "Folder",
                "value": 1910,
                "folderName": "ProgramQueryTestFolder"
            },
            "status": "",
            "workspace": "Default",
            "tags": [
                {
                    "tagType": "AAA1 Required Tag Type",
                    "tagValue": "AAA1 RT1"
                }
            ],
            "costs": null,
            "headStart": false
        }
    ]
}

依名稱

Get Program by Name端點需要name查詢引數。 選用布林查詢引數是includeTagsincludeCosts,分別用來傳回程式標籤和程式成本。

GET /rest/asset/v1/program/byName.json?name=TestProgramName&includeTags=true
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "16026#14db03e070c",
    "result": [
        {
            "id": 1107,
            "name": "AAA2QueryProgramName",
            "description": "AssetAPI: getProgram tests",
            "createdAt": "2015-05-21T22:45:13Z+0000",
            "updatedAt": "2015-05-21T22:45:13Z+0000",
            "url": "https://app-devlocal1.marketo.com/#PG1107A1",
            "type": "Default",
            "channel": "Online Advertising",
            "folder": {
                "type": "Folder",
                "value": 1910,
                "folderName": "ProgramQueryTestFolder"
            },
            "status": "",
            "workspace": "Default",
            "tags": [
                {
                    "tagType": "AAA1 Required Tag Type",
                    "tagValue": "AAA1 RT1"
                }
            ],
            "costs": null,
            "headStart": false
        }
    ]
}

瀏覽

取得程式端點可讓您瀏覽程式。

選用的status引數可讓您篩選程式狀態。 此引數僅適用於參與和電子郵件計畫。 參與計畫的值可能是「開啟」和「關閉」,電子郵件計畫的值可能是「已解鎖」。

選用的maxReturn引數控制要傳回的程式數目(最大值為200,預設值為20)。 用於分頁結果的選用offset引數(預設為0)。

請注意,此端點不會傳回與方案相關聯的標籤。 可以使用依ID取得程式依名稱取得程式來擷取程式標籤。

GET /rest/asset/v1/programs.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "7a39#1511bf8a41c",
    "result": [
        {
            "id": 1035,
            "name": "clone it",
            "description": "",
            "createdAt": "2015-11-18T15:25:35Z+0000",
            "updatedAt": "2015-11-18T15:25:46Z+0000",
            "url": "https://app-devlocal1.marketo.com/#NP1035A1",
            "type": "Engagement",
            "channel": "Nurture",
            "folder": {
                "type": "Folder",
                "value": 28,
                "folderName": "Nurturing"
            },
            "status": "on",
            "workspace": "Default",
            "headStart": false
        },
        {
            "id": 1032,
            "name": "email prog",
            "description": "",
            "createdAt": "2015-11-18T14:56:28Z+0000",
            "updatedAt": "2015-11-18T14:56:28Z+0000",
            "url": "https://app-devlocal1.marketo.com/#EBP1032A1",
            "type": "Email",
            "channel": "Email Send",
            "folder": {
                "type": "Folder",
                "value": 26,
                "folderName": "Data Management"
            },
            "status": "unlocked",
            "workspace": "Default",
            "headStart": false
        }
    ]
}

依日期範圍

我們的取得程式端點的earliestUpdatedAtlatestUpdatedAt引數可讓您為傳回在指定範圍內更新或最初建立的程式設定低和高的日期時間浮水印。

GET /rest/asset/v1/programs.json?earliestUpdatedAt=2017-01-01T00:00:00-05:00&latestUpdatedAt=2017-01-30T00:00:00-05:00
{
    "success": true,
    "errors": [],
    "requestId": "1225a#15f82a83875",
    "warnings": [],
    "result": [
        {
            "id": 1070,
            "name": "Bulk Import - Test",
            "description": "",
            "createdAt": "2017-01-13T19:34:17Z+0000",
            "updatedAt": "2017-01-13T19:34:18Z+0000",
            "url": "https://app-abm.marketo.com/#PG1070A1",
            "type": "Default",
            "channel": "Content",
            "folder": {
                "type": "Folder",
                "value": 637,
                "folderName": "Avention"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
        },
        {
            "id": 1069,
            "name": "Program With Email",
            "description": "",
            "createdAt": "2017-01-03T22:53:14Z+0000",
            "updatedAt": "2017-01-03T22:53:15Z+0000",
            "url": "https://app-abm.marketo.com/#EBP1069A1",
            "type": "Email",
            "channel": "Email Send",
            "folder": {
                "type": "Folder",
                "value": 621,
                "folderName": "Smartling"
            },
            "status": "unlocked",
            "workspace": "Default",
            "headStart": false
        },
        {
            "id": 1071,
            "name": "Program with Guided Landing Page Template",
            "description": "",
            "createdAt": "2017-01-24T22:59:21Z+0000",
            "updatedAt": "2017-01-24T22:59:22Z+0000",
            "url": "https://app-abm.marketo.com/#PG1071A1",
            "type": "Default",
            "channel": "Content",
            "folder": {
                "type": "Folder",
                "value": 621,
                "folderName": "Smartling"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
        },
        {
            "id": 1047,
            "name": "ReachForce List Update",
            "description": "",
            "createdAt": "2016-05-24T19:38:35Z+0000",
            "updatedAt": "2017-01-13T19:28:09Z+0000",
            "url": "https://app-abm.marketo.com/#PG1047A1",
            "type": "Default",
            "channel": "Content",
            "folder": {
                "type": "Folder",
                "value": 407,
                "folderName": "Everly Tests"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
        }
    ]
}

依標籤型別

依標籤取得程式端點會擷取符合所提供標籤型別和標籤值的程式清單。

有兩個必要的引數,tagType是要篩選的標籤型別,tagValue是要篩選的標籤值。  有一個可選整數maxReturn引數可控制要傳回的程式數目(最大值為200,預設值為20),以及一個可選整數offset引數用於分頁結果(預設值為0)。  結果會以隨機順序傳回。

GET /rest/asset/v1/program/byTag.json?tagType=Presenter&tagValue=Dennis
{
    "success" : true,
    "warnings" : [],
    "errors" : [],
    "requestId" : "13b6d#152b38d5be4",
    "result" : [{
            "id" : 1004,
            "name" : "It's a Program",
            "description" : "",
            "createdAt" : "2013-02-26T00:37:37Z+0000",
            "updatedAt" : "2013-03-11T15:32:02Z+0000",
            "url" : "https://app-sjst.marketo.com/#PG1004A1",
            "type" : "Default",
            "channel" : "Email Blast",
            "folder" : {
                "type" : "Folder",
                "value" : 38,
                "folderName" : "Test"
            },
            "status" : "",
            "workspace" : "Default",
            "tags" : [{
                    "tagType" : "Presenter",
                    "tagValue" : "Dennis"
                }
            ],
                        "headStart": false
    ]
}

建立和更新

[建立]https://developer.adobe.com/marketo-apis/api/asset/#tag/Programs/operation/createProgramUsingPOST)和更新程式遵循標準資產模式,並以foldernametypechannel為必要引數,descriptioncoststags為選用引數。 頻道和型別只能在建立方案時設定。 建立後只能更新描述、名稱、tagscosts,並允許額外的costsDestructiveUpdate引數。 將costsDestructiveUpdate傳遞為true將會導致所有現有成本被清除,並取代為通話中包含的任何成本。 請注意,在某些訂閱中,某些計畫型別可能需要標籤,但這取決於設定,應該首先使用「取得標籤」檢視是否有執行個體特定要求。

建立或更新電子郵件程式時,也可能傳遞startDateendDate

建立

POST /rest/asset/v1/programs.json
Content-Type: application/x-www-form-urlencoded
name=API Test Program&folder={"id":1035,"type":"Folder"}&description=Sample API Program&type=Default&channel=Email Blast&costs=[{"startDate":"2015-01-01","cost":2000}]
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "d505#14d9bd96352",
    "result": [
        {
            "id": 1207,
            "name": "newProgram",
            "description": "This is a test",
            "createdAt": "2015-05-28T18:47:15Z+0000",
            "updatedAt": "2015-05-28T18:47:15Z+0000",
            "url": "https://app-devlocal1.marketo.com/#ME1207A1",
            "type": "Event",
            "channel": "channelOne",
            "folder": {
                "type": "Folder",
                "value": 59,
                "folderName": "blah blah"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
            "tags": null,
            "costs": [
                {
                    "startDate":"2015-01-01",
                    "cost":2000
                }
            ]
        }
    ]
}

更新

更新程式成本時,若要附加新成本,只需將其新增至您的costs陣列即可。 若要執行破壞性更新,請傳遞您的新成本,以及設定為true的引數costsDestructiveUpdate。 若要清除程式的所有成本,請勿傳遞costs引數,只傳遞costsDestructiveUpdate設定為true

POST /rest/asset/v1/program/{id}.json
Content-Type: application/x-www-form-urlencoded
description=This is an updated description&name=Updated Program Name&costs=[{"startDate":"2016-01-01","cost":200,"note":"Google Adwords"}]
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "5c37#14db05608aa",
    "result": [
        {
            "id": 1110,
            "name": "Updated Program Name",
            "description": "This is a updated description",
            "createdAt": "2015-05-21T22:45:14Z+0000",
            "updatedAt": "2015-06-01T18:13:58Z+0000",
            "url": "https://app-devlocal1.marketo.com/#NP1110A1",
            "type": "Engagement",
            "channel": "Nurture",
            "folder": {
                "type": "Folder",
                "value": 1910,
                "folderName": "ProgramQueryTestFolder"
            },
            "status": "on",
            "workspace": "Default",
            "headStart": false,
            "tags": [
                {
                    "tagType": "AAA1 Required Tag Type",
                    "tagValue": "AAA1 RT1"
                },
                {
                    "tagType": "tagTypeOne",
                    "tagValue": "tagTypeValue1"
                }
            ],
            "costs": [
                {
                    "startDate": "2016-01-01",
                    "cost": 200,
                    "note": "Google Adwords"
                }
            ]
        }
    ]
}

核准

電子郵件程式可從遠端核准或未核准,這將導致程式在指定的startDate執行,並在指定的endDate結束。 兩者都必須設定為核准方案,並透過UI設定有效及核准的電子郵件和智慧清單。

核准

POST /rest/asset/v1/program/{id}/approve.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "16026#150b5bf7692",
    "result": [
        {
            "id": 11062
        }
    ]
}

取消核准

POST /rest/asset/v1/program/{id}/unapprove.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "16026#150b5bf7692",
    "result": [
        {
            "id": 11062
        }
    ]
}

原地複製

復製程式會遵循標準資產模式,將新名稱和資料夾作為必要引數和選擇性說明。  name引數必須是全域唯一的,而且不能超過255個字元。  folder引數是父資料夾。  folder引數型別屬性必須設定為「資料夾」,而且目標資料夾必須與複製中的程式位於相同的工作區。

包含特定資產型別的程式可能無法透過此API進行複製,包括推送通知、應用程式內訊息、報表和社交Assets。 應用程式內程式可能無法透過此API進行複製。

POST /rest/asset/v1/program/{id}/clone.json
Content-Type: application/x-www-form-urlencoded
name=Cloned Program - PHP&folder={"id":5562,"type":"Folder"}&description=Description
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "3a7f#14db06990cc",
    "result": [
        {
            "id": 1221,
            "name": "cloneProgram",
            "description": "This is a description for the cloned program",
            "createdAt": "2015-06-01T18:36:57Z+0000",
            "updatedAt": "2015-06-01T18:36:57Z+0000",
            "url": "https://app-devlocal1.marketo.com/#PG1221A1",
            "type": "Default",
            "channel": "Blog",
            "folder": {
                "type": "Folder",
                "value": 59,
                "folderName": "blah blah"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
            "tags": null,
            "costs": null
        }
    ]
}

刪除程式

刪除計畫會遵循標準資產刪除模式。

POST /rest/asset/v1/program/{id}/delete.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "16501#14db042c6b7",
    "result": [
        {
            "id": 1109
        }
    ]
}
recommendation-more-help
bb269a6d-047a-4bf7-9acd-23ad9a63dc59