Smart APIs provide a single OData action and corresponding OData function to manage report execution.
-
ExecuteReport - call this OData action to execute a report.
-
GetExecuteReportResultAsync - call this OData function to monitor report status (relevant only if ExecuteReportAction is called asynchronously).
Here are some sample URLs you can use to execute/monitor reports defined for the SampleService:
You will have to use a tool such as Postman to call ExecuteReportAction; OData actions are called with HTTP POST.
-
POST https://sam.spclouddave.com/SampleService/Sppid/V2/Pipes('302')/Reports('Report 302')/Com.Ingr.Core.V1.ExecuteReport/
If you examine the metadata document for the SampleService, you will notice there is a parameters parameter available for the ExecuteReportAction:
https://sam.spclouddave.com/SampleService/Sppid/V2/$metadata
<Action Name="ExecuteReport" IsBound="true">
.
<Parameter Name="parameters" Type="Edm.String" Nullable="false"/>
.
</Action>
Supported parameters are accessible via the Parameters collection from a report instance, for example:
GET https://sam.spclouddave.com/SampleService/Sppid/v2//Pipes('302')/Reports('Report 302')/Parameters
You can pass report parameters in the body of your request with the following JSON body syntax:
{
"parameters": "@startDate ge 2015-12-01T00:00:00-05:00
and @endDate lt 2016-01-01T00:00:00-05:00
and @status eq 'Active'"
}
The value passed for parameters must be a valid OData $filter expression.
-
GET https://sam.spclouddave.com/SampleService/Sppid/V2/Pipes('302')/Reports('Specification 302')/Com.Ingr.Core.V1.GetExecuteReportResultAsync(resultId='0ffce2fb-9de9-451c-b6eb-0ae9083f1468')/
The URI to get the report result shown is an example. The URI represents a status monitor resource returned as an HTTP Location header in the response, when ExecuteReportAction is called asynchronously. See Asynchronous support for full details.