I want to create a end of day template, my code as below:
JSONOrderedObject TAndCTemplateJSONObject = new JSONOrderedObject()
.put("@odata.type","#ThomsonReuters.Dss.Api.Extractions.ReportTemplates.ElektronTimeseriesReportTemplate")
.put("ShowColumnHeaders", false)
.put("Name", reportTemplateName)
.put("Headers", new JSONArray() )
.put("Trailers", new JSONArray() )
.put("ContentFields", new JSONArray()
.put( new JSONObject() .put("FieldName", "RIC") .put( "Format", JSONObject.NULL)) .put( new JSONObject() .put("FieldName", "Volume") .put( "Format", JSONObject.NULL) ) .put( new JSONObject() .put("FieldName", "Open Price") .put( "Format", JSONObject.NULL) ) .put( new JSONObject() .put("FieldName", "Low Price") .put( "Format", JSONObject.NULL) ) ) .put("Condition", JSONObject.NULL);
but Receive some error:
org.apache.http.client.HttpResponseException: Bad Request at org.apache.http.impl.client.AbstractResponseHandler.handleResponse(AbstractResponseHandler.java:70) at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:66) at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:52) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:223) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140) at com.thomsonreuters.dss.api.example.DSS2ImmediateScheduleTermsAndCondition.createEODReportTemplate(DSS2ImmediateScheduleTermsAndCondition.java:471) at com.thomsonreuters.dss.api.example.DSS2ImmediateScheduleTermsAndCondition.main(DSS2ImmediateScheduleTermsAndCondition.java:101)