GET reports/runRequest?ReportGuid={ReportGuid}&CustomerID={CustomerID}&StartDate={StartDate}&EndDate={EndDate}&TagID={TagID}&ActiveDeviceWithin={ActiveDeviceWithin}&OutputFormat={OutputFormat}&DealerID={DealerID}

Run report request. You could get report result by firing a request to reports/runResult/... endpoint. Roles: ApiRole

To fetch a report from JetAdvice, you are required to send 3 requests to our server:

1. GET /reports/RunRequest Registers a report request to be processed on server, which is returned with "ReportRequestGuid".
2. GET /reports/RunResult Fetches the status of "ReportRunGuid"(=ReportRequestGuid) from server. If completed, it returns with list of File identifiers.
3. GET /reports/RunResultFile Fetches the actual report from server for specified file identifier.

Http has request header Accept and we have query param OutputFormat both of which handles formatting of response, but there's difference in usage as explained below:

  1. Http request header Accept is used to control the format of the response of any request except /reports/Run and /reports/RunResultFile endpoints. For ex:
    • Accept: application/xml (or text/xml), will return the response in XML format.
    • Accept: application/json (or text/json), will return the response in JSON format.
  2. OutputFormat is specifically used in /reports/Run and /reports/RunRequest endpoints. This controls the format of report to be generated. For ex:
    • &outputformat=5, will generate the report in JSON format.
    • &outputformat=2, will generate the report in XML format.
    • &outputformat=1, will generate the report in CSV format.

Why this new design?

  1. To work around our existing /reports/Run endpoint's limitation of Http timeout for larger reports.
  2. To let our customers be able to perform asynchronous requests and handle responses with better performance using async programming.
  3. To avoid any threads or connections consuming longer time to generate report.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
ReportGuid

The Report to run.

globally unique identifier

Required

CustomerID

The Customer to run the View for

integer

Required

StartDate

Optional - Format (utc): "dd-mm-yyyy+hh:mm:ss" (date is required, time is optional) - Default is 3 months ago

date

None.

EndDate

Optional - Format (utc): "dd-mm-yyyy+hh:mm:ss" (date is required, time is optional) - Default is NOW

date

None.

TagID

Optional - Result of view, will only contain devices tagged with Tag ID.

integer

None.

ActiveDeviceWithin

Optional - Set this to filter devices.

ActiveDeviceWithin

None.

OutputFormat

Optional - Output format of the generated report

OutputFormat_Values

None.

DealerID

Optional - Dealer ID

integer

None.

Examples:

https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234                                                               // Period = last 3 months
https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234&outputformat=2                                                // Report in Xml format                
https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234&dealerid=123                                                  // Report to run for DealerID = 123
https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234&startdate=01-01-2015                                          // Period = from 01/01/2015 till NOW
https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234&startdate=01-01-2015&enddate=01-01-2016                       // Period = Whole 2015
https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234&startdate=01-01-2015&enddate=31-12-2015+23:59:59              // Period = Whole 2015
https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234&startdate=01-01-2015+00:00:00&enddate=31-12-2015+23:59:59     // Period = Whole 2015
https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234&tagid=123                                                     // Require devices to be tagged with Tag ID = 123                
https://api2.jetadvice.com/reports/runRequest?reportguid=fa463591-f6c5-4aa4-a7a8-16c3f0955a1d&customerid=1234&activedevicewithin=123                                        // Require devices to be Active within ActiveDeviceWithinID = 123
            

Response Information

Resource Description

ReportRunRequest
NameDescriptionTypeAdditional information
ReportGuid

Report identifier.

globally unique identifier

None.

ReportRequestGuid

Report request identifier.

globally unique identifier

None.

Response Formats

application/json, text/json

Sample:
{
  "ReportGuid": "6a8c95f8-ba36-49ac-bc33-e8de00f6d559",
  "ReportRequestGuid": "9daf2750-9365-4f4d-acf9-df60127739ac"
}

application/xml, text/xml

Sample:
<ReportRunRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ReportGuid>6a8c95f8-ba36-49ac-bc33-e8de00f6d559</ReportGuid>
  <ReportRequestGuid>9daf2750-9365-4f4d-acf9-df60127739ac</ReportRequestGuid>
</ReportRunRequest>