Sensor Data Export API
The Sensor Data Export API enables administrators to programmatically query for sensor data using a simple HTTP URL string invocation combined with a pre-configured key that enables secure access to the data without requiring the manual entry of username and password.
When invoked, the API will return a CSV-formatted file containing the data for the specified sensors. The API can be used to automate periodic data downloads for integration into existing documents, spreadsheets, third-party tools, or other reporting mechanisms.
To learn how to generate your API key parameter, refer to Generating API keys for integrations.
API syntax
https://secure.exoprise.com/api/v1/sensors/export_data.csv?apikey=acct_api_key&period=period&ids=sensor_id_list
Arguments
Argument |
Description |
---|---|
apikey |
The unique secure account identifier obtained by going to the account's profile page. |
period |
The look-back period for the query. Accepted values: 3h, 6h, 12h, 1d, 7d, 30d, and 90d. |
ids |
A comma-separated list of one or more sensor IDs. For any given sensor, you can obtain the sensor ID from the URL displayed while on the sensor detail page. In this example URL, the sensor ID would be in place of 1234: https://secure.exoprise.com/email_sensors/1234#/7/logon/1/3 |
im
|
Includes additional meta-data for each row. This enables easy pivoting of sensor data. Included meta-data:
To add additional meta-data to each export row, pass &im=true on the export line. |
tc |
Title concatenation. To enable sensor title concatenation for each column, add &tc=true to the URL. |
Examples
Retrieve sensor data for the last three hours for three specific sensors by ID: Example Sensor 1 (ID 1234), Example Sensor 2 (ID 5678), and Example Sensor 3 (ID 9876).
https://secure.exoprise.com/api/v1/sensors/export_data.csv?apikey=0fbdd7b4bb4a0c5439ea61e8e6331234&period=3h&ids=1234,5678,9876
Export file format
The API returns results as CSV-formatted data (which most web browsers will provide as a .csv file). The file contains one header row, plus one row for each measurement point during the designated time period. The total number of rows returned is uniform across sensor types; however, the number varies depending on the time period specified.
The first column of the returned file is labeled created_at, with each cell containing a timestamp entry for the row. The remaining columns contain sensor data. Column headings are in the following format:
sensor_type:site_dsplay_name[:sensor_display_name]_series_name
Field |
Description |
---|---|
sensor_type |
Specifies the type of sensor (for example, ADFS, BOX, DNS, EMAIL, WMON, and so on.) |
site_display_name |
The display name for the site as specified in Site Settings. If no display name has been set, this will display the default value for the machine name hosting the site. |
sensor_display_name |
The display name for the sensor as specified in Sensor Settings. If no display name has been set, this field is omitted. |
series_name |
The name of the particular data series displayed in the column. The number of available series as well as the series names vary by sensor type. |
Sensor data is grouped together by sensor, in the order specified in the request.
Example (subset of rows and columns)
created_at |
EMAIL:Boston (PROD):prodtestuser_logon_time |
EMAIL:Boston (PROD):prodtestuser_mta_receive_time |
EMAIL:Boston (PROD):prodtestuser_incoming_latency |
---|---|---|---|
2015-01-01 21:00:00 UTC |
3288 |
7785 |
76.66929 |
2015-01-01 22:00:00 UTC |
3306 |
7758 |
73.89908 |
2015-01-01 23:00:00 UTC |
3363 |
7643 |
73.2838 |
2015-01-02 00:00:00 UTC |
3098 |
7496 |
74.84083 |
2015-01-02 01:00:00 UTC |
3431 |
8174 |
71.88194 |
2015-01-02 02:00:00 UTC |
3213 |
8259 |
74.91374 |
2015-01-02 03:00:00 UTC |
3507 |
8260 |
82.56295 |
2015-01-02 04:00:00 UTC |
3386 |
7948 |
80.41726 |
2015-01-02 05:00:00 UTC |
3321 |
9447 |
82.98525 |