Marketo Leads - 如何找到 progressionStatus 字段的更新值

Marketo Leads - How to find the updated values of progressionStatus field

我需要获取在 "progressionStatus" 字段(内部成员资格)上发生变化且具有 API 的 Marketo 潜在客户。 我可以毫无问题地获得与项目相关的所有潜在客户(通过 ProgramID API 获取潜在客户),但我需要获得那些在 "progressionStatus" 列上发生变化的潜在客户。 我正在考虑使用程序的 CreatedAt / UpdatedAt 字段,然后获取与这些程序相关的所有线索。但是我没有得到我想要的准确结果。 此外,我尝试使用 GET Lead 更改 API 并将 "fields" 参数用于 "progressionstatus",但该字段不存在。

有可能解决这个问题吗? 提前致谢。

您可以通过查询 Get Lead Activities 端点来获取进展状态发生变化的潜在客户列表。

Get Lead Changes endpoint could sound as a good candidate, but that endpoint only returns changes on the lead fields. Progression status change is not stored on the lead directly, so at the end that won't work. On the other hand the Get Leads by ProgramId 端点 returns – 除其他外 – progressionStatus 的实际值(父程序中潜在客户的程序状态)而不是“ change”本身,所以你不能基于它来处理结果集。

好消息是进度状态变化是 activity 类型 幸运的是我们有上面提到的 Get Lead Activities 端点(也被称为Query 在 API 文档中)可用于查询。此端点还允许按 activityTypeIds 过滤以将结果集缩小为单个 activity 类型 .

基本上你必须调用 GET /rest/v1/activities.json enpoint 并将 activityTypeIdsnextPageToken 的值作为查询参数传递(显然在访问令牌旁边)。因此,首先您需要获取 activity 类型 的内部 ID,称为“Change Status in Progression”。您可以通过查询 GET /rest/v1/activities/types.json endpoint and look for a record with that name. (I don't know if this Id changes from instance to instance, but in ours it is the #104). Also, to obtain a nextPageToken you have to make a call to GET /rest/v1/activities/pagingtoken.json as well, where you have to specify the earliest datetime to retrieve activities from. See more about Paging Tokens.

来做到这一点

一旦你掌握了所有这些位,你就可以这样提出你的请求:

GET https://<INSTANCE_ID>.mktorest.com/rest/v1/activities.json?activityTypeIds=<TYPE_ID>&nextPageToken=<NEXTPAGE_TOKEN>&access_token=<ACCESS_TOKEN>

它给出的结果是一个包含如下项目的数组,这很容易进一步处理。

{
    "id":712630,
    "marketoGUID":"712630",
    "leadId":824864,
    "activityDate":"2017-12-01T08:51:13Z",
    "activityTypeId":104,
    "primaryAttributeValueId":1104,
    "primaryAttributeValue":"PROGRAM_NAME",
    "attributes":[
        {"name":"Acquired By","value":true},
        {"name":"New Status ID","value":33},
        {"name":"Old Status ID","value":32},
        {"name":"Reason","value":"Filled out form"},
        {"name":"Success","value":false},
        {"name":"New Status","value":"Filled-out Form"},
        {"name":"Old Status","value":"Not in Program"}
    ]
}

知道有问题的 leadId,您可以再次请求获取实际的潜在客户记录。