Reports

URI Definition

Method

URI and Fields

GET/iap/reports

Returns all reports that the current user is permitted to read.

Success Response

Collection of reports.

Example

https://localhost/iap/reports


Response

[
   {
       "reportId": 1280,
       "reportDefinitionId": 1269,
       "startDateTime": "2019-03-17T00:00:00+03:00[Europe/Moscow]",
       "endDateTime": "2019-03-29T14:54:31+03:00[Europe/Moscow]",
       "reportDataDTO": [
           {
               "date": "2019-03-22T16:39:22.711-07:00[America/Los_Angeles]",
               "customer": "Customer 1",
               "geozone": "World",
               "group": null,
               "device": "00D07111EAC0",
               "value": "8335"
           },
           {
               "date": "2019-03-24T16:39:22.711-07:00[America/Los_Angeles]",
               "customer": "Customer 1",
               "geozone": "World",
               "group": null,
               "device": "00D07111EAC0",
               "value": "7336"
           },
           {
               "date": "2019-03-25T16:39:22.711-07:00[America/Los_Angeles]",
               "customer": "Customer 1",
               "geozone": "World",
               "group": null,
               "device": "00D07111EAC0",
               "value": "7963"
           },
           {
               "date": "2019-03-26T16:39:22.711-07:00[America/Los_Angeles]",
               "customer": "Customer 1",
               "geozone": "World",
               "group": null,
               "device": "00D07111EAC0",
               "value": "8133"
           },
           {
              "date": "2019-03-27T16:39:22.711-07:00[America/Los_Angeles]",
               "customer": "Customer 1",
               "geozone": "World",
               "group": null,
               "device": "00D07111EAC0",
               "value": "8006"
           }
       ]
   }
]                                                                                                                                                   

/iap/reports/{id}

Returns a report with the specified ID, only if the current user is permitted to read that report. Returns nothing otherwise.

Parameters

  • Id - the ID of a report

Success Response

Report with the specified ID.

Example

https://localhost/iap/reports/1280


Response

{
   "reportId": 1280,
   "reportDefinitionId": 1269,
   "startDateTime": "2019-03-17T00:00:00+03:00[Europe/Moscow]",
   "endDateTime": "2019-03-29T14:54:31+03:00[Europe/Moscow]",
   "reportDataDTO": [
       {
           "date": "2019-03-22T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "8335"
       },
       {
           "date": "2019-03-24T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "7336"
       },
       {
           "date": "2019-03-25T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "7963"
       },
       {
           "date": "2019-03-26T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "8133"
       },
       {
           "date": "2019-03-27T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "8006"
       }
   ]
}                                                                                                                                                   


/iap/reports/types

Returns collection of all the report types.

Success Response

Collection of all report types.

Example

https://localhost/iap/reports/types


Response

[
   {
       "reportTypeId": 1,
       "name": "Energy Usage Trend"
   },
   {
       "reportTypeId": 2,
       "name": "Data Log Trend"
   },
   {
       "reportTypeId": 3,
       "name": "Maintenance Report"
   },
   {
       "reportTypeId": 4,
       "name": "Asset Report"
   },
   {
       "reportTypeId": 5,
       "name": "Data Trend Report"
   }
]                                                                                                                                                   

/iap/reports/definitions

Returns all report definitions that the current user is permitted to access

Success Response

Collection of report definitions.

Example

https://localhost/iap/reports/definitions


Response

[
   {
       "reportDefinitionId": 1269,
       "reportTypeId": 5,
       "name": "DTR",
       "reportTypeName": "Data Trend Report",
       "definitionProperties": {
           "scope": {
               "type": "device",
               "selectType": "select",
               "ids": [
                   "2"
               ],
               "pids": [
                   2
               ]
           },
           "granularity": "NONE",
           "datapointName": "nviPassword",
           "datapointTypeId": "SNVT_count"
       },
       "reports": [
       ]
   },
   {
       "reportDefinitionId": 2101,
       "reportTypeId": 5,
       "name": "Data Trend Report",
       "reportTypeName": "Data Trend Report",
       "definitionProperties": {
           "scope": {
                "type": "device",
               "selectType": "select",
               "ids": [
                   "2",
                   "20",
                   "13"
               ],
               "pids": [
                   2,
                   20,
                   13
               ]
           },
           "granularity": "NONE",
           "datapointName": "nviPassword",
           "datapointTypeId": "SNVT_count"
       },
       "reports": [
       ]
   }
]                                                                                                                                                   



/iap/reports/definitions/{id}

Returns the report definitions for the specified ID.

Parameters

  • id - the ID of a report definition

Success Response

Report definition with the specified ID.

Example

https://localhost/iap/reports/definitions/1269


Response

{
   "reportDefinitionId": 1269,
   "reportTypeId": 5,
   "name": "DTR",
   "reportTypeName": "Data Trend Report",
   "definitionProperties": {
       "scope": {
           "type": "device",
           "selectType": "select",
           "ids": [
               "2"
           ],
           "pids": [
               2
           ]
       },
       "granularity": "NONE",
       "datapointName": "nviPassword",
       "datapointTypeId": "SNVT_count"
   },
   "reports": [
   ]
}                                                                                                                                                   

PUT

/iap/reports/definitions/delete

Deletes report definitions with the specified IDs.

Request Body

The request body must contain the IDs of the report definitions to be deleted.


Success Response

Collection with IDs of deleted report definitions.

Example

https://localhost/iap/reports/definitions/delete

Request Body

[1269,2101]

Response

[
  1269,
   2101
]                                                                                                                                                   


/iap/reports/definitions

Updates an already existing report definition with the specified properties.

Request Body

The request body must contain the ID of the report definition to update and the properties with which the specified report definition will be updated.

Success Response

Successfully updated report definition.

Example

https://localhost/iap/reports/definitions


Request Body

{
 "reportTypeId":5,
 "name":"UPDATED Data Trend Report",
 "definitionProperties":{
   "scope":{
     "type":"device",
     "selectType":"select",
     "ids":["2","20"],
     "pids":[2,20]
   },
   "granularity":"NONE",
   "datapointName":"nviPassword",
   "datapointTypeId":"SNVT_count"
 }
}

Response

{
   "reportDefinitionId": 2112,
   "reportTypeId": 5,
   "name": "UPDATED Data Trend Report",
   "reportTypeName": "Data Trend Report",
   "definitionProperties": {
       "datapointName": "nviPassword",
       "datapointTypeId": "SNVT_count",
       "granularity": "NONE",
       "scope": {
           "type": "device",
           "selectType": "select",
           "ids": [
               "2",
               "20"
           ],
           "pids": [
               2,
               20
           ]
       }
   },
   "reports": [
   ]
}                                                                                                                                                   

/iap/reports/exportByID

Exports the report with the specified ID as a CSV file.

Request Body

The request body must contain the ID of a report definition to export.

Success Response

CSV file containing the report with the specified ID.

Example

https://localhost/iap/reports/exportByID


Request Body

2121

Response

CSV file with the following content:
customer,dataType,date,device,endDateTime,geozone,group,startDateTime,value"Customer 1",nviPassword,
"2019-03-22T16:39:22.711-07:00[America/Los_Angeles]",00D07111EAC0,"2019-04-18T15:11:59+03:00[Europe/Moscow]",
World,,"2018-04-18T00:00+03:00[Europe/Moscow]",8335"Customer 1",nviPassword,
"2019-03-24T16:39:22.711-07:00[America/Los_Angeles]",00D07111EAC0,"2019-04-18T15:11:59+03:00[Europe/Moscow]",
World,,"2018-04-18T00:00+03:00[Europe/Moscow]",7336"Customer 1",nviPassword,
"2019-03-25T16:39:22.711-07:00[America/Los_Angeles]",00D07111EAC0,"2019-04-18T15:11:59+03:00[Europe/Moscow]",
World,,"2018-0418T00:00+03:00[Europe/Moscow]",7963"Customer 1",nviPassword,
"2019-03-26T16:39:22.711-07:00[America/Los_Angeles]",00D07111EAC0,"2019-04-18T15:11:59+03:00[Europe/Moscow]",
World,,"2018-04-18T00:00+03:00[Europe/Moscow]",8133"Customer 1",nviPassword,
"2019-03-27T16:39:22.711-07:00[America/Los_Angeles]",00D07111EAC0,"2019-04-18T15:11:59+03:00[Europe/Moscow]",
World,,"2018-04-18T00:00+03:00[Europe/Moscow]",8006                                                                                                                                                   

/iap/reports/delete 

Deletes reports with the specified IDs.

Request Body

The request body must contain the report IDs to be deleted.

Success Response

IDs of deleted reports.

Example

https://localhost/iap/reports/delete

Request Body

[1280,2106]

Response

[
   1280,
   2106
]                                                                                                                                                    

POST



/iap/reports

Returns reports for the specified data range and report definition.

Request Body

The request body must contain the date range and report definition ID.

Success Response

Generated report.

Example

https://localhost/iap/reports

Request Body

{
"reportDefinitionId":2101,
"startDateTime":"2018-04-18T00:00:00+03:00[Europe/Moscow]",
"endDateTime":"2019-04-18T14:43:28+03:00[Europe/Moscow]"
}

Response

{
   "reportId": 2111,
   "reportDefinitionId": 2101,
   "startDateTime": "2018-04-18T00:00:00+03:00[Europe/Moscow]",
   "endDateTime": "2019-04-18T14:43:28+03:00[Europe/Moscow]",
   "reportDataDTO": [
       {
           "date": "2019-03-22T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "8335"
       },
       {
           "date": "2019-03-24T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "7336"
       },
       {
           "date": "2019-03-25T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "7963"
       },
       {
           "date": "2019-03-26T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "8133"
       },
       {
           "date": "2019-03-27T16:39:22.711-07:00[America/Los_Angeles]",
           "customer": "Customer 1",
           "geozone": "World",
           "group": null,
           "device": "00D07111EAC0",
           "value": "8006"
       }
   ]
}                                                                                                                                                   


/iap/reports/definitions

Creates report definitions using the specified properties

Request Body

The request body must contain properties from which new report definitions will be created.

Success Response

Successfully created report definition.

Example

https://localhost/iap/reports/definitions

Request Body

{
 "name":"NEW Data Trend Report",
 "reportTypeId":5,
 "definitionProperties":{
   "scope":{
     "type":"device",
     "selectType":"select",
     "ids":["2","20","13"]
   },
   "granularity":"NONE",
   "datapointName":"nviPassword",
   "datapointTypeId":"SNVT_count"
 }
}

Response

{
   "reportDefinitionId": 2112,
   "reportTypeId": 5,
   "name": "NEW Data Trend Report",
   "reportTypeName": "Data Trend Report",
   "definitionProperties": {
       "scope": {
           "type": "device",
           "selectType": "select",
           "ids": [
               "2",
               "20",
               "13"
           ],
           "pids": [
               2,
               20,
               13
           ]
       },
       "granularity": "NONE",
       "datapointName": "nviPassword",
       "datapointTypeId": "SNVT_count"
   },
   "reports": [
   ]
}                                                                                                                                                   



/iap/reports/exportByID

Returns a report for the specified properties and date range.

Request Body

The request body must contain the date range and the report definition properties

Success Response

Generated report.

Example

https://localhost/iap/reports/widgetReport

Request Body

{
 "definitionProperties":{
   "granularity":"NONE",
   "scope":{
     "ids":["7"],
     "selectType":"select",
     "type":"device"
    }
  },
  "name":"WDLT_16625",
  "reportTypeId":2,
  "reportDefinitionId":null,
  "metadata":{},
  "period":"Last week",
  "startDateTime":"2019-04-11T00:00:00+03:00[Europe/Moscow]",
  "endDateTime":"2019-04-18T15:15:02+03:00[Europe/Moscow]"
}


Response


   "reportId": null,
   "reportDefinitionId": null,
   "startDateTime": "2019-04-11T00:00:00+03:00[Europe/Moscow]",
   "endDateTime": "2019-04-18T15:15:02+03:00[Europe/Moscow]",
   "reportDataDTO": [ 
  ]
}                                                                                                                                                   


DELETE

/iap/reports/{id}

Deletes the report with the specified ID.

Parameters

    • Id - the ID of a report to delete

Success Response

Returns the state of the performed operation. True for success, False otherwise.

Example

https://localhost/iap/reports/2111


Response

{
   "value": true
}                                                                                                                                                   

/iap/reports/definitions/{id}

Deletes the report definitions with the specified ID.

Parameters

  • id - the ID of the report definition to delete

Success Response

Returns the status of the performed operation. True for success, and False otherwise.

Example

https://localhost/iap/reports/definitions/2112


Response

{
   "value": true
}                                                                                                                                                   



Query Parameters

Optional query parameters can be used with your REST request.  Specifying queries is described under Queries and ParametersPath Parameters, and Query Parameters.