【问题标题】:How can we log Custom Activity data against leads with Marketo REST API?我们如何使用 Marketo REST API 记录针对潜在客户的自定义活动数据?
【发布时间】:2018-03-21 06:02:36
【问题描述】:

我们已经使用 Marketo 门户网站创建了一个自定义活动,并且我们能够使用 REST API 创建潜在客户。那么现在,我们如何使用 Marketo REST API 记录自定义活动数据?
自定义Activity结构如下:

{
    "id": 100001,
    "name": "TEST_ACTIVITY",
    "apiName": "test_api_c",
    "description": "",
    "primaryAttribute": {
        "name": "event_id",
        "apiName": "event_id",
        "dataType": "string"
    },
    "attributes": [
        {
            "name": "email",
            "apiName": "email",
            "dataType": "email"
        },
        {
            "name": "event_data",
            "apiName": "event_data",
            "dataType": "string"
        }
    ]
}

【问题讨论】:

    标签: marketo


    【解决方案1】:

    您可以将自定义活动记录推送到Add Custom Activities 端点,该端点位于POST /rest/v1/activities/external.json url。

    首先,值得注意的是,为了使用端点,API 用户必须具有“读写活动”权限。
    端点需要一个带有单个 input 键的有效负载,它可以容纳多达 300 条活动记录。对于每个活动记录,leadIdactivityDateactivityTypeIdprimaryAttributeValueattributes 字段是必需的,如果是属性数组,name 是普通的“名称”字段,而不是“apiName”。

    在您的情况下,有效负载看起来像这样:

    {  
        "input":[// Note the array of records
            {
                "activityDate":"2018-03-20T22:43:12+02:00",
                "activityTypeId":100001,
                "leadId":<LEAD_ID>,
                "primaryAttributeValue":"<YOUR_EVENT_ID>",
                "attributes":[
                    {
                        "name":"email",// This is the `name` field of the attribute, not the `apiName`!
                        "value":"<EMAIL_ADDRESS>"
                    },
                    {
                        "name":"event_data",// This is the `name` field of the attribute, not the `apiName`!
                        "value":"<EVENT_DATA>"
                    }
                ]
            },
            //{
            //  …other activity records…
            //}
        ]
    }
    

    【讨论】:

    • 有没有办法在没有潜在客户 ID 的情况下做同样的事情(发布自定义活动)。需要 2 种情况 - 1. 匿名用户活动 2. 用户刚刚通过自定义表单登录,因为我的代码仍然没有潜在客户 ID,而只有电子邮件 ID
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-15
    • 2015-03-15
    相关资源
    最近更新 更多