我正在尝试通过 Marketo 的 REST API批量更新一堆现有记录。根据文档, Import Lead 功能似乎是理想的选择。
简而言之,我在使用文档中的 curl 示例时收到错误“610 Resource Not Found”。这是我采取的一些步骤。
- 获取 auth_token 不是问题:
$ curl "https://<identity_path>/identity/oauth/token?
grant_type=client_credentials&client_id=<my_client_id>
&client_secret=<my_client_secret>"
- 证明令牌有效,获取单个潜在客户也不是问题:
# Fetch the record - outputs just fine
$ curl "https://<rest_path>/rest/v1/lead/1.json?access_token=<access_token>"
# output:
{
"requestId": "ab9d#12345abc45",
"result": [
{
"id": 1,
"updatedAt": "2014-09-18T13:00:00+0000",
"lastName": "Potter",
"email": "harry@hogwartz.co.uk",
"createdAt": "2014-09-18T12:00:00+0000",
"firstName": "Harry"
}
],
"success": true
}
- 现在很痛苦,当我尝试使用Import Lead 功能上传 CSV 文件时。像这样:
# "Import Lead" function
$ curl -i -F format=csv -F file=@test.csv -F access_token=<access_token>
"https://<rest_path>/rest/bulk/v1/leads.json"
# results in the following error
{
"requestId": "f2b6#14888a7385a",
"success": false,
"errors": [
{
"code": "610",
"message": "Requested resource not found"
}
]
}
错误代码文档仅说明Requested resource not found ,仅此而已。所以我的问题是:是什么导致了 610 错误代码 -我该如何解决?
我尝试了进一步的步骤,但没有成功:
- 将 access_token 作为 url 参数放置(例如,将 '?access_token=xxx' 附加到 url),没有效果。
- 将 CSV(是的,它是逗号分隔的)剥离到最低限度(例如,只有字段 'id' 和 'lastName')
- 看了问题Marketo API and Python, Post request failed
- 已验证 CSV 没有一些时髦的行尾
- 我不知道 CSV 文件是否有特定要求,例如列顺序,不过......
有什么提示或建议吗?