Report Execution

The Report execution API is used to execute a report and get result back in JSON format. The developer can access the API using the URL - http://<instanceurl>/oms/api/v1/report/{ResourceName}, where {ResourceName} is the name which you used to create the report API.

Sample input JSON:

{
"pageSize": 1,
"filters": {
"TestModel.TestString": "sampleValue",
"TestModel.TestLongField": 12345
},
"page": 1,
"flattenRows": false
}
  • pageSize: Number of records per page. If not provided, a default pageSize of 50 will be used.

  • page: The page to be returned, starting with page 1.

  • filters: Filter field values defined in the report in JSONObject format.

  • flattenRows: If true, this will transform the returned rows from an array of JSON Objects into an array of ordered arrays. One value of the child array will correspond to one row of the report, with the values in the array placed in the order of [“TestModel.TestString”, “TestModel.TestFloat”].

Sample JSON response without flattenRows:

{
"hasMorePages": true,
"rows": [
{
"TestModel.SiteName(SPT)": "AsiaKolkataSite",
"PTA.TestModel.TestSiteAlias(EPT)": "KolkataSite",
"TestModel.TestFloat": 15.1392,
"TestModel.TestString": "Hello",
"TestModel.TestDouble": 12.9312
}
]
}

Sample JSON response with flattenRows:

{
"hasMorePages": true,
"rows": [
[
"Hello",
15.1392,
12.9312,
null,
null,
"AsiaKolkataSite",
"KolkataSite"
]
],
"fields": [
"TestModel.TestString",
"TestModel.TestFloat",
"TestModel.TestDouble",
"PTA.TestModel.TestLongField(DPA)",
"TestModel.TestLongFieldB(DPB)",
"TestModel.SiteName(SPT)",
"PTA.TestModel.TestSiteAlias(EPT)"
]
}