智能列表
创建对象:
- 管理员
Marketo提供了一组REST API用于对智能列表执行操作。 这些API遵循资产API的标准界面模式,提供查询、删除和克隆选项。
注意:仅用户创建的智能列表支持这些API。 它们不能用于内置/系统智能列表。
查询
查询智能列表遵循ID为🔗的的资产、名称为的以及浏览的标准查询类型。
按Id
按ID进行查询,将单个智能列表id
作为路径参数并返回单个智能列表记录。 或者,您可以传递includeRules
布尔参数以在响应中包含智能列表规则。
GET /rest/asset/v1/smartList/{id}.json?includeRules=true
{
"success": true,
"errors": [],
"requestId": "6efc#16c8967a21f",
"warnings": [],
"result": [
{
"id": 4363,
"name": "Smart List Test 01",
"createdAt": "2019-06-03T23:01:13Z+0000",
"updatedAt": "2019-06-04T17:37:45Z+0000",
"url": "https://app-sjqe.marketo.com/#SL4363A1LA1",
"folder": {
"id": 1041,
"type": "Program"
},
"workspace": "Default",
"rules": {
"filterMatchType": "all",
"triggers": [],
"filters": [
{
"id": 459,
"name": "Visited Web Page",
"ruleTypeId": 1,
"ruleType": "Activity",
"operator": "occurs",
"conditions": [
{
"activityAttributeId": 1,
"activityAttributeName": "Web Page",
"operator": "is",
"values": [
"Program Test.Landing Page Test 01"
],
"isPrimary": true
},
{
"activityAttributeId": 6,
"activityAttributeName": "Browser",
"operator": "is",
"values": [
"Chrome"
],
"isPrimary": false
},
{
"activityAttributeId": -101,
"activityAttributeName": "Date of Activity",
"operator": "in past",
"values": [
"30 days"
],
"isPrimary": false
}
]
}
]
}
}
]
}
按智能营销活动Id
按智能营销活动ID查询将单个智能营销活动id
作为路径参数并返回单个智能列表记录。 或者,您可以传递includeRules
布尔参数以在响应中包含智能列表规则。
GET /rest/asset/v1/smartCampaign/{smartCampaignId}/smartList.json
{
"success": true,
"errors": [],
"requestId": "6efc#16c8967a21f",
"warnings": [],
"result": [
{
"id": 4363,
"name": "Smart List Test 01",
"createdAt": "2019-06-03T23:01:13Z+0000",
"updatedAt": "2019-06-04T17:37:45Z+0000",
"url": "https://app-sjqe.marketo.com/#SL4363A1LA1",
"folder": {
"id": 1041,
"type": "Program"
},
"workspace": "Default"
}
]
}
按项目ID
按程序ID查询将单个电子邮件程序id
作为路径参数并返回单个智能列表记录。 或者,您可以传递includeRules
布尔参数以在响应中包含智能列表规则。
GET /rest/asset/v1/program/{programId}/smartList.json
{
"success": true,
"errors": [],
"requestId": "6efc#16c8967a21f",
"warnings": [],
"result": [
{
"id": 4363,
"name": "Smart List Test 01",
"createdAt": "2019-06-03T23:01:13Z+0000",
"updatedAt": "2019-06-04T17:37:45Z+0000",
"url": "https://app-sjqe.marketo.com/#SL4363A1LA1",
"folder": {
"id": 1041,
"type": "Program"
},
"workspace": "Default"
}
]
}
按名称
按名称查询将智能列表name
作为参数并返回单个智能列表记录。 对实例中的所有智能列表名称执行完全匹配的字符串,并返回与该名称匹配的智能列表的结果。
GET /rest/asset/v1/smartList/byName.json?name=2018 Leads
{
"success": true,
"errors": [],
"requestId": "115d7#16423bc13b4",
"result": [
{
"id": 283988,
"name": "2018 Leads",
"createdAt": "2008-10-07T15:20:39Z+0000",
"updatedAt": "2010-04-13T15:34:32Z+0000",
"url": "https://app-abm.marketo.com/#SL283988A1",
"folder": {
"id": 31,
"type": "Folder"
},
"workspace": "Default"
}
]
}
浏览
智能列表也可在批次🔗中检索。 folder
参数用于指定执行查询的父文件夹。 它被格式化为包含id
和type
的JSON对象。 与其他批量资源检索端点一样,offset
和maxReturn
是可用于分页的可选参数。 可选的earliestUpdatedAt
和latestUpdatedAt
日期时间参数可用于按UpdatedAt日期范围筛选结果。
GET /rest/asset/v1/smartLists.json?folder={"id":31,"type":"Folder"}
{
"success": true,
"errors": [],
"requestId": "9aa4#16423c0e969",
"result": [
{
"id": 283988,
"name": "2018 Leads",
"createdAt": "2008-10-07T15:20:39Z+0000",
"updatedAt": "2010-04-13T15:34:32Z+0000",
"url": "https://app-abm.marketo.com/#SL283988A1",
"folder": {
"id": 31,
"type": "Folder"
},
"workspace": "Default"
},
{
"id": 299697,
"name": "Active Prospects",
"createdAt": "2008-10-17T02:09:49Z+0000",
"updatedAt": "2010-03-27T18:27:46Z+0000",
"url": "https://app-abm.marketo.com/#SL299697A1",
"folder": {
"id": 31,
"type": "Folder"
},
"workspace": "Default"
},
{
"id": 400517,
"name": "Leads by Score",
"createdAt": "2009-01-07T18:52:52Z+0000",
"updatedAt": "2010-04-13T15:36:09Z+0000",
"url": "https://app-abm.marketo.com/#SL400517A1",
"folder": {
"id": 31,
"type": "Folder"
},
"workspace": "Default"
}
]
}
克隆
使用application/x-www-form-urlencodedPOST执行智能列表的克隆。 在id
路径参数中指定要克隆的智能列表。 folder
参数用于指定要在其下创建智能列表的父文件夹,其格式为包含ID和类型的JSON对象。 父文件夹必须是程序或智能列表文件夹。 name
参数用于命名新的智能列表,必须是唯一的。 (可选)可以使用description
参数描述智能列表。
POST /rest/asset/v1/smartList/{id}/clone.json
Content-Type: application/x-www-form-urlencoded
folder={"id":31,"type":"Folder"}&name=2018 Leads Qualified
{
"success": true,
"errors": [],
"requestId": "a672#16423d755ed",
"result": [
{
"id": 788645,
"name": "2018 Leads Qualified",
"createdAt": "2018-06-21T19:34:32Z+0000",
"updatedAt": "2018-06-21T19:34:32Z+0000",
"url": "https://app-abm.marketo.com/#SL788645A1",
"folder": {
"id": 31,
"type": "Folder"
},
"workspace": "Default"
}
]
}
删除
删除智能列表需要一个智能列表id
作为路径参数。
POST /rest/asset/v1/smartList/{id}/delete.json
{
"success": true,
"errors": [],
"requestId": "8f5#16423dd0fbe",
"result": [
{
"id": 788645
}
]
}