public static void main(String[] args) throws PlayTradeApiCallException, InterruptedException
{
final int NUMBER_OF_DAYS = 2; //the number of days we want to generate an order report for
//create a request order report call
GenerateReportNowCall call = new GenerateReportNowCall(
ReportName.Order,
NUMBER_OF_DAYS );
//set the authentication
call.setUsername("user@email.com");
call.setPassword("password");
//make the call to generate the order report
StandardCallResult result = call.callGenerateReportNow();
if ( result.getSuccess() != null )
{
System.out.println("Sucess :" + result.getSuccess() );
/* wait a while for the report to be generated,
* reports can take several minutes to be generated
*/
Thread.sleep( 30000 );
//we requested a report from the previous run, try and get the report ID for it
GetReportStatusCall getreportstatus = new GetReportStatusCall(ReportName.Order);
getreportstatus.setNumberOfReports(3);
//set the authentication
call.setUsername("user@email.com");
call.setPassword("password");
//make the call
GetReportStatusCallResult rsresult = getreportstatus.callGetReportStatus();
//have a look at all the reports