简体   繁体   English

过滤器被 Salesforce Reporting REST API 忽略了?

[英]Filters ignored with Salesforce Reporting REST API?

I'm trying to run a Salesforce custom report with runtime filters, as described on the page at https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_filter_reportdata.htm#example_requestbody_execute_resource我正在尝试使用运行时过滤器运行 Salesforce 自定义报告,如https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_filter_reportdata.htm#example_requestbody_execute_resource上的页面所述

However, whenever I run the report (async) with a handcrafted JSON block, the result report ignores the filters and brings back the full result set.但是,每当我使用手工制作的 JSON 块运行报告(异步)时,结果报告都会忽略过滤器并带回完整的结果集。 The filters are also not listed in the reportMetadata block in the response.过滤器也未在响应的 reportMetadata 块中列出。

I'm posting to the URL: https://SALESFORCEINSTANCE/services/data/v31.0/analytics/reports/00Oo0000004aH7R/instances?includeDetails=true我发布到 URL: https://SALESFORCEINSTANCE/services/data/v31.0/analytics/reports/00Oo0000004aH7R/instances?includeDetails=true

The JSON for the body of my POST request: { "reportMetadata": { "name": "All Contacts", "id": "00Oo0000004aH7R", "reportFormat": "TABULAR", "reportBooleanFilter": "1 AND 2", "reportFilters": [我的 POST 请求正文的 JSON:{ "reportMetadata": { "name": "All Contacts", "id": "00Oo0000004aH7R", "reportFormat": "TABULAR", "reportBooleanFilter": "1 AND 2" , "报告过滤器": [
{ "value": "selma.husser@cox.net", "column": "EMAIL", "operator": "notEqual"}, { "value": "aonofrio@onofrio.com", "column": "EMAIL", "operator": "notEqual"} ], "detailColumns": [ "CONTACT_ID", "FIRST_NAME", "LAST_NAME", "ADDRESS2_STREET", "ADDRESS2_CITY", "ADDRESS2_STATE", "ADDRESS2_ZIP", "ADDRESS2_COUNTRY", "PHONE1", "EMAIL" ], { "value": "selma.husser@cox.net", "column": "EMAIL", "operator": "notEqual"}, { "value": "aonofrio@onofrio.com", "column": " EMAIL", "operator": "notEqual"} ], "detailColumns": [ "CONTACT_ID", "FIRST_NAME", "LAST_NAME", "ADDRESS2_STREET", "ADDRESS2_CITY", "ADDRESS2_STATE", "ADDRESS2_ZIP", "ADDRESS2_COUNTRY" "电话 1", "电子邮件" ],

"developerName" => "All_Contacts", "developerName" => "All_Contacts",

"reportType" =>  {
  "label" =>  "Contacts & Accounts",
  "type" =>  "ContactList"
}
    "currency": null,
    "aggregates": [       ],
    "sortBy": "CONTACT_ID"     

} }

找到答案:必须将 Content-Type 标头设置为“application/json”,否则 Salesforce 将忽略您的请求正文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM