静态列表
Marketo提供了一组REST API,用于对静态列表执行CRUD操作。 这些API遵循资产API的标准界面模式,提供查询、创建、更新和删除选项。
有关列表成员的Lead数据库操作,请参阅列表成员资格。
查询
按Id
按ID进行查询,将单个静态列表id作为路径参数并返回单个静态列表记录。
GET /rest/asset/v1/staticList/{id}.json
{
"success": true,
"errors": [],
"requestId": "843c#1641f969e96",
"result": [
{
"id": 1021,
"name": "Foundation Seed List",
"createdAt": "2017-07-27T01:38:33Z+0000",
"updatedAt": "2017-07-27T01:39:26Z+0000",
"folder": {
"id": 13,
"type": "Folder"
},
"computedUrl": "https://app-sjqe.marketo.com/#ST1021A1"
}
]
}
按名称
按名称查询将静态列表name作为参数并返回单个静态列表记录。 对实例中的所有静态列表名称执行完全匹配的字符串,并返回与该名称匹配的静态列表的结果。
GET /rest/asset/v1/staticList/byName.json?name=Foundation Seed List
{
"success": true,
"errors": [],
"requestId": "28ab#1641fa246b9",
"result": [
{
"id": 1021,
"name": "Foundation Seed List",
"createdAt": "2017-07-27T01:38:33Z+0000",
"updatedAt": "2017-07-27T01:39:26Z+0000",
"folder": {
"id": 13,
"type": "Folder"
},
"computedUrl": "https://app-sjqe.marketo.com/#ST1021A1"
}
]
}
浏览
静态列表也可在批次🔗中检索。 folder参数可用于指定将在其中执行查询的父文件夹,并将其格式化为包含id和type的JSON对象。 与其他批量资源检索端点一样,offset和maxReturn是可用于分页的可选参数。 earliestUpdatedAt和latestUpdatedAt参数允许您为返回在给定范围内创建或更新的静态列表设置低日期时间水印和高日期时间水印。 日期时间值必须是有效的ISO-8601字符串,并且不应包括毫秒。
GET /rest/asset/v1/staticLists.json?folder={"id":13,"type":"Folder"}
{
"success": true,
"errors": [],
"requestId": "2dc0#1641f846633",
"result": [
{
"id": 1021,
"name": "Foundation Seed List",
"createdAt": "2017-07-27T01:38:33Z+0000",
"updatedAt": "2017-07-27T01:39:26Z+0000",
"folder": {
"id": 13,
"type": "Folder"
},
"computedUrl": "https://app-sjqe.marketo.com/#ST1021A1"
},
{
"id": 1022,
"name": "Blacklist Seed List",
"createdAt": "2017-07-27T23:19:33Z+0000",
"updatedAt": "2017-07-27T23:21:29Z+0000",
"folder": {
"id": 13,
"type": "Folder"
},
"computedUrl": "https://app-sjqe.marketo.com/#ST1022A1"
},
{
"id": 1023,
"name": "Possible Duplicates Seed List",
"createdAt": "2017-07-28T00:10:02Z+0000",
"updatedAt": "2017-07-28T00:11:22Z+0000",
"folder": {
"id": 13,
"type": "Folder"
},
"computedUrl": "https://app-sjqe.marketo.com/#ST1023A1"
}
]
}
创建和更新
创建静态列表是使用application/x-www-form-urlencoded POST和两个必需的参数执行的。 folder参数用于指定将在其下创建静态列表的父文件夹,并将其格式化为包含id和type的JSON对象。 name参数用于命名静态列表,必须是唯一的。 (可选)可以使用description参数描述静态列表。
POST /rest/asset/v1/staticLists.json
Content-Type: application/x-www-form-urlencoded
folder={"id":1034,"type":"Program"}&name=My Static List
{
"success": true,
"errors": [],
"requestId": "1269d#164209d6e1e",
"result": [
{
"id": 1027,
"name": "My Static List",
"createdAt": "2018-06-21T04:32:25Z+0000",
"updatedAt": "2018-06-21T04:32:25Z+0000",
"folder": {
"id": 1034,
"type": "Program"
},
"computedUrl": "https://app-sjqe.marketo.com/#ST1027A1"
}
]
}
使用两个可选参数通过单独的终结点更新静态列表。 description参数可用于更新静态列表描述。 name参数可用于更新静态列表名称,并且必须是唯一的。
POST /rest/asset/v1/staticList/{id}.json
Content-Type: application/x-www-form-urlencoded
description=This is a static list used for testing
{
"success": true,
"errors": [],
"requestId": "f84f#16420b4c746",
"result": [
{
"id": 1027,
"name": "My Static List",
"description": "This is a static list used for testing",
"createdAt": "2018-06-21T04:32:26Z+0000",
"updatedAt": "2018-06-21T04:57:55Z+0000",
"folder": {
"id": 1034,
"type": "Program"
},
"computedUrl": "https://app-sjqe.marketo.com/#ST1027A1"
}
]
}
删除
删除静态列表需要一个静态列表id作为路径参数。 无法删除导入或导出操作正在使用的静态列表,或其他资产正在使用的静态列表。
POST /rest/asset/v1/staticList/{id}/delete.json
{
"success": true,
"errors": [],
"requestId": "2c79#16420ded0e9",
"result": [
{
"id": 1027
}
]
}
recommendation-more-help
bb269a6d-047a-4bf7-9acd-23ad9a63dc59