我正在使用python库 marketo-rest-api 从Marketo中提取数据。我只是拉了一天试图将活动中的点点连接到广告系列。我正在拨打以下电话:
print('Getting Campaigns')
with open(marketoCampaignsFile,'w') as fcamp:
campaigns = mc.execute(method='get_multiple_campaigns', id=None, name=None, programName=None, workspaceName=None, batchSize=None)
for campaign in campaigns:
jsonString = json.dumps(campaign)
fcamp.write(jsonString)
fcamp.close()
print('Getting Activities...')
activitiesFile = 'c:\\users\\mark\\marketocsv\\emailActivities.2016-07-26.json'
with open(activitiesFile,'w',newline='') as fopen:
for activities in mc.execute(method='get_lead_activities_yield', activityTypeIds=['6','7','8','9','10'], nextPageToken=None, sinceDatetime='2016-07-26', untilDatetime='2016-07-27', batchSize=None, listId=None, leadIds=None):
for item in activities:
jsonString = json.dumps(item)
fopen.write(jsonString+'\n')
fopen.close()
我发现活动文件中的广告系列ID与广告系列文件中的任何广告系列ID都不匹配。有谁知道为什么会这样?我需要广告系列属性才能过滤我需要的特定活动。感谢。
答案 0 :(得分:1)
您下载的活动类型不包含广告系列ID,而是提供电子邮件ID。
答案 1 :(得分:1)
所以Jep是对的。我终于找到了EmailID。它被称为primaryAttributeValueId
。您可以将其链接回Marketo提供的EmailID。我从未找到campaignID
,但我可以通过电子邮件进入广告系列。以下是其中一个请求的完整JSON:
{
"primaryAttributeValue": "2016-07-Email-To-Customers",
"activityDate": "2016-07-26T19:05:41Z",
"attributes": [{
"value": "0",
"name": "Choice Number"
},
{
"value": "43182",
"name": "Step ID"
}
],
"primaryAttributeValueId": 17030,
"leadId": 115345,
"id": 393962103,
"activityTypeId": 7,
"campaignId": 15937
}