Envizi API Technical Documentation
API Root URL
The Envizi API is a Web Service API and the URL always starts with the following:
For Australia, New Zealand and ASEAN users - https://auapi.envizi.com/api
For US and Canada users - https://usapi.envizi.com/api
For UK and South African users - https://ukapi.envizi.com/api
A valid Envizi user name and password must be supplied for authentication.
There should be no space or any other non URL standard characters supplied in the API address.
The Envizi API employs Basic Authentication method, which is the same as accessing Envizi's main user interface - using a user name and password. It is recommended to create a new login exclusively for the API access especially if your reporting tool resides in a shared environment, but you can always use your existing Envizi login if that is preferred.
If a new login is created to access the API, you will need to use it to log into Envizi's main interface first to activate it, e.g., by accepting terms & conditions. Once this is done, please allow additional 5 minutes before the new login becomes activated for the API.
SSO logins are not able to access the Envizi API - SSO credentials are being defined and authored by your own organization rather than Envizi. In order to access the API, you would need to create a new physical Envizi login with user name and password for the authentication.
The Envizi API is communicated on HTTPS protocol over TLS1.2.
API Meta option
The /meta option allows you to see the list of API reports that are available to your login. If you manage multiple organizations, it will also display a list of organizations you have access to. This is usually the first API query to be run when you start to set up your application to work with the Envizi API. It can also be used to verify your application's environmental setting such as having valid credentials.
The API report names retrieved here are the reports that you are able to use with all other meta and data API calls.
JSON Output (partial)
Retrieve Report Parameters in API Meta Option
/meta/reports/<API report name>
Similar to running report in Envizi's main user interface, with Envizi API you are able to specify report parameters, such as report ending period, location name etc. However there is no user interface in API to allow you to make such selections - the solution to this is to use the meta/reports/<API report name> API call.
Unlike running reports from Envizi's main interface, in the API, for Envizi entities such as Location and Group, their exact Envizi Id must be specified in the API data call. The meta/reports/<API report name> call allows you to retrieve list of available parameter names and their ids in the specified report. These parameter names and ids can then be used in the actual API data calls later.
The /meta/reports/<API report name> allows you to see the following, provided they are applicable to the report:
List of applicable Locations, their Location Ids and its default value
List of applicable Groups, their Group Ids and its default value
List of applicable Utility Types, their Utility Type Ids (a.k.a. Data Types) and its default value
List of available reporting period, e.g. 1 month, 3 months and its default value
Default value for reporting end period, e.g. 31-Dec-2018
JSON Output (partial)
API Data Option
/data/<API report name>
Once you have retrieved API report names through meta option, you can use the data option to retrieve the data. The naming convention for all Envizi supplied API reports is that they all start with '_Envizi', followed by a dash '-' and then the API report name, e.g., _Envizi-MonthlyDataSummary.
Specify the API report name after /data/ to call the API, e.g. , https://usapi.envizi.com/api/data/_Envizi-MonthlyDataSummary
Report data requested in this way does not have any input parameters. This will be accepted by the system and it will result in default parameter values being used. In some cases this will be equivalent to running the same report on Envizi's main user interface without changing any of the default report selections, but for some reports, the API will return more data, with all the possible report selection combinations.
JSON Output (partial)
Currency of API Data
Data retrieved from most API reports are close to live data in the system, with up to a maximum of 15 minutes of delay. Hence in certain circumstances they may be different from the values you see on Dashboards or Power Reports, which typically have a longer refresh cycle of 24 hours.
Specify Parameters in API Data Option
/data/<API report name>?Parameter1=Value1&Parameter2=Value2&...
Sometimes it may make sense to restrict and reduce the amount of data returned in the API to optimize the data retrieval process. This can be done by supplying the optional report parameters in the API call, after appending a question mark ? to the API report name. Multiple parameters can also be specified, and each should be separated by an ampersand & sign.
Most parameter values should use the internal id instead of its name, e.g., use Location_Id = 12345 instead of Location_Name = Aberfoyle. The list of names and ids mapping can be found through /meta/reports/<API report name> call.
When specifying the values for parameters, you must not surround values with single or double quotes - only open values are accepted.
The format for date should always follow YYYY/MM/DD, e.g. 2018/12/31
JSON Output (partial)
This API requests data for 1 month ending 2018-Oct-31 and for one particular location only.
Period and End_Period
'Period' and 'End_Period' are important parameters to determine the reporting data output range. If these parameters are not specified in the API URL, the platform will default them to user's personal setting, which is usually 12 months ending with previous month. For example, if the API report is run in May-2019, then 'Period' will be defaulted to 12 and 'End_Period' will be defaulted to 2019/04/30.
In addition to specifying a date, the 'End_Period' parameter can also take the following values to suite the need in different situations, especially if the API is to be used recurrently. e.g., always to run for current month.
For example, ...?End_Period=Current_Month&Period=1 will always return data for current month only.
List of available API Reports
Reports in Envizi are constantly being reviewed and enabled for API access. There are about 40+ API reports currently available in the API module. You can use the following query to find out the list of accessible API reports based on your login credential:
Common Problems with API authentication
If for some reason your existing API login does not seem to be working any more, please check whether you can log in through the main Envizi user interface with the same credential. If you also experience problem logging in from the main user interface, chances are that your API login may have been disabled after the number of failed login attempts exceeded your organization's password security threshold (default is 10 times). This feature is in place to prevent any unauthorised access to the system in the way of brute-force attack, e.g., by submitting many passwords with the hope of eventually guessing it correctly.
In such cases you can either request your system admin to reset the password for the API login, or to delete and create a new Envizi login with the same credential details to avoid disruption to your established data automation processes.