Hi there,@manigandan.r
When i request the extraction result from a Time and Sales report schedule - i get different results using exactly the same request.
I see the file size is exactly the same but my call to response.getEntity().getContent() appears to return inconsistent results. E.g. the last 2 calls i made to the API, T&S returned 69937 vs 101031 lines.
This is how i set up my client:
private CloseableHttpClient httpclient = HttpClientBuilder.create().build();
.....
String urlGet = this.url + "/Extractions/ReportExtractions('"+reportExtractionId+"')/Files";
HttpGet request = new HttpGet(urlGet);
request.addHeader("Authorization", "Token "+this.sessionToken);
HttpResponse response = this.httpclient.execute(request);
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) { result.append(line); }
JSONObject jsonGetResponse = new JSONObject(result.toString());
JSONArray valueJArray = jsonGetResponse.getJSONArray("value");
String ExtractedFileId = ""; String ExtractedFileName = ""; String FileType = ""; boolean success = false;
for (int i = 0; i < valueJArray.length(); i++)
{
ExtractedFileId = valueJArray.getJSONObject(i).getString("ExtractedFileId");
......
//FileType="Full"
urlGet = this.url + "/Extractions/ExtractedFiles('"+ExtractedFileId+"')/$value";
request = new HttpGet(urlGet);
request.addHeader("Authorization", "Token "+this.sessionToken);
response = this.httpclient.execute(request);
HttpEntity entity = response.getEntity();
rd = new BufferedReader(new InputStreamReader(entity.getContent()));
......
while ((line = rd.readLine()) != null) {...}
......
}
The same code works fine for Depth extraction which also has a gzipped file output.
Am i missing something here please?
Thanks