How to connect ADS API in ICM TSDB

Mel Meng
4 min readMar 25, 2021

Source: Innovyze Support Portal

ICM TSDB provides a streamlined process for getting external monitoring, forecasting time series data into the ICM model. Once the external connection is setup, the retrieval of the data is automated. When ICM runs a model, it automatically pulls the needed input data from the sources. When the run completes, it automatically pulls the data for comparison/calibration. For utilities with permanent flow meters in ground, a TSDB enabled workflow can eliminate tedious data preparation work which can easily take hours to days for each model run. These efficiency gains will enable and empower the utility to gain more insights into the system by running the model more often with real data.

Many utilities are using ADS’s flow monitoring platform managing flow monitoring data. ICM TSDB (Time series database) supports direct connection using ADS API for flow monitoring data. Once the TSDB is setup, the modeler can easily build TVD connectors to bring the ADS data into the model as input and calibration data.

Connect to ADS API

ICM uses the ADS API for pulling the data into TSDB, for more information about ADS API, refer to the official API page:
https://api.adsprism.com/swagger/index.html

Before setting up the connection, you need to contact ADS to get the developer or API key. It is a long string of text, something looks like this:
MQQzMTQxRTItMUN0Ni00QUZFLTaCMDktNzAyRTlFQsMxQTY5

Database sources tab
A sample of the database sources tab is shown below,

Server: https://api.adsprism.com
Database: api/Telemetry
Password: the developer key, it is a very long string of text.
Time zone: it is also important to set the time zone. If left blank, the system will assume it is the same as the computer’s time zone, which can change (for example using VMs hosted in a different time zone).
NOTE: ICM always uses standard time for the simulation, therefore all the data coming into the model needs to be in standard time (daylight saving time needs to be adjusted.)

The observed tab
A sample is shown below, most of the fields can be set using the information from the ADS website.

For the connection, fill the following fields,

  • External data source: the database connection entry data source name
  • Table: pick the location, the list should populate automatically
  • Data Column: the field to be used, for example QFINAL, DFINAL, VFINAL for final flow, depth and velocity. The list should populate automatically.

Troubleshooting connection

A common issue when setting up the connection is errors introduced when copy and pasting the url and passwords. Make sure no extra space and line break is copied. If copying from an excel table, try not to copy the cell which might include a tailing line break. Instead, get into the cell and copy the text.

Another issue is the information provided might not be correct, and verify the connection information, follow the instruction below to test the ADS API.

Test ADS API

ADS has an official API page, where the user can test the API: https://api.adsprism.com/swagger

  • Authorize
  • Get a list of the values reported. For example QFINAL is the flow for a meter, and its ID is 2303. We will need this ID when querying for the time series data.
  • Get a list of locations
  • We will need the ID for each flow metering location for the telemetry query, as shown below in the response, we have two sites with the IDs of 70 and 171.
  • Query the time series for location 171 of QFINAL (2303) from 3/20–3/25/2021

And here we got the response below.

--

--