Boomi对接Marketo API时HTTP连接器URL动态参数替换失败
Boomi AtomSphere对接Marketo Bulk Export API时URL动态参数替换失效问题
流程步骤
我的Boomi流程包含以下步骤:
- 通过数据处理(JavaScript)创建JSON请求体
- 调用Marketo Bulk Export API(HTTP连接器)
- 通过数据处理(Groovy)解析响应并提取
exportId - 使用另一个HTTP连接器调用Enqueue Export Job API,需传入上述
exportId
问题现象
步骤4中,exportId未被正确替换到URL中,请求日志显示URL为:
https://[instance].mktorest.com/bulk/v1/leads/export/{exportId}/enqueue.json
实际值并未替换{exportId},返回错误响应:
{"requestId":"[request-id]","success":false,"errors":[{"code":"1013","message":"Export id '{exportId}' not found"}]}
已尝试操作
- 在Groovy脚本中将提取到的exportId存储为文档属性:
// 从JSON响应中提取exportId String exportId = json.result[0].exportId // 存储为文档属性 props.setProperty("exportId", exportId) props.setProperty("extractedExportId", exportId)
- 尝试多种URL格式:
https://[instance].mktorest.com/bulk/v1/leads/export/{exportId}/enqueue.json https://[instance].mktorest.com/bulk/v1/leads/export/${document.exportId}/enqueue.json https://[instance].mktorest.com/bulk/v1/leads/export/${document.property.exportId}/enqueue.json
- 尝试通过Map/Profile结合正则表达式从消息文本中提取exportId
已确认连接器前的消息包含正确的exportId:
Marketo Bulk Export: Success Export ID: 57646fgh65test Status: Created EXPORTID=57646fgh65test
正确解决方案
1. URL动态参数替换的正确语法
Boomi HTTP连接器中,引用文档属性的正确语法是 ${document.properties.属性名},针对你的场景,URL应写为:
https://[instance].mktorest.com/bulk/v1/leads/export/${document.properties.exportId}/enqueue.json
注意:语法是properties(复数形式),这是之前尝试的语法错误点。
2. exportId的正确传递流程
确保以下步骤正确执行:
- 在Groovy脚本中,确认
props是文档属性对象,需通过document.getProperties()获取:def props = document.getProperties() String exportId = json.result[0].exportId props.setProperty("exportId", exportId) - 在HTTP连接器配置中,选择使用动态URL,将上述URL填入对应字段,Boomi会自动解析
${document.properties.exportId}并替换为实际值。 - 可在连接器前添加文档属性查看器形状,验证
exportId属性存在且值正确。
环境信息
- Boomi AtomSphere
- Marketo REST API v1
内容的提问来源于stack exchange,提问作者Prins
相关产品推荐
相关产品推荐

