我正在尝试从 OIC 调用 UDSA 公开的 REST API(具体来说是 Rest 适配器)。
https://mpr.datamart.ams.usda.gov/ws/report/v1/cattle/LM_CT100?filter={"filters":[{"fieldName ":"报告%20date","operatorType":"EQUAL","values":["01/10/2018"]}]}
API 本身具有多个过滤器(以 JSON 格式导出),并且可以在浏览器或 Postman 等 API 客户端上正常工作。 但是,我无法在 OIC Rest 适配器触发器中对查询进行建模。
我试图将过滤条件作为 POST 请求正文传递,但这是不允许的。
有什么指点吗?
此网址无法过滤
GET https://mpr.datamart.ams.usda.gov/services/v1.1/reports
此网址确实可以过滤
GET https://mpr.datamart.ams.usda.gov/services/v1.1/reports/{report number}
示例
https://mpr.datamart.ams.usda.gov/services/v1.1/reports/2466?q=report_date=01/10/2018
{
"reportSection": "Summary",
"reportSections": [
"Summary",
"Detail",
"History"
],
"stats": {
"totalRows:": 1,
"returnedRows:": 1,
"userAllowedRows:": 99999
},
"results": [
{
"report_date": "01/10/2018",
"previous_day_head_count": "37,373",
"same_day_prev_week_head_count": "550",
"same_day_prev_year_head_count": "19",
"current_week_head_count": "68,620",
"previous_week_head_count": "550",
"previous_year_head_count": "857",
"is_correction": null,
"narrative": null,
"report_title": "5 Area Daily Weighted Average Direct Slaughter Cattle - Negotiated (PDF) (LM_CT100)",
"slug_name": "AMS_2466",
"slug_id": "2466",
"office_name": "St Joseph, MO",
"office_code": "LS-SJ",
"office_city": "Saint Joseph",
"office_state": "MO",
"market_location_name": "St. Joseph, MO",
"market_location_city": "St. Joseph",
"market_location_state": "MO",
"market_type": "Direct Livestock - LMR Cattle",
"market_type_category": "Direct Livestock - LMR Cattle",
"published_date": "01/10/2018 10:32:45"
}
]
}
详细文档在这里