2

如何在 SnapLogic 中以 JSON 数据为主体制作 REST Post?

我需要发布到 yahoo 批量文件下载端点 ( https://api.admanager.yahoo.com/v1/rest/bulk/download ) 并且请求正文必须是 JSON 格式:

{
  "advertiserId": 30944,
  "objectType": "CAMPAIGN",
  "downloadAllLevels": true,
  "filters": {
             "objectIds": [123,
                456
             ],
             "objectStatus": [
                "ACTIVE"
             ],
             "fromDate": "2014-07-01 00:00:00",
             "toDate": "2014-07-10 00:00:00",
                         "includeNegative":true,
                         "includeTargeting":true,
                         "includeExtensions":true
  }
}
4

1 回答 1

2

为此,您需要添加一个 JSON 生成器对象并在那里添加您的 JSON 数据。

然后您可以将其附加到 REST Post 对象。在 Post 对象中,确保将HTTP entity值设置为$($ = 根路径)或您要发送的 JSON 数据的路径。

JsonGenerator

现在将使用此 json 数据作为正文发送帖子

于 2016-11-15T22:50:57.483 回答