AQSync Application programming interface (API) V1
Starting with version 3.0.14, an Application Programming Interface (API) was added to the AQSync to facilitate communication. The various endpoints will provide additional insight into the current state of the software.
Technical Note No. 063
AQSync Application Programming Interface (API) V1
Date: 11/21/2024
Author: Thomas Kopala
Summary:
Starting with version 3.0.14, an Application Programming Interface (API) was added to
the AQSync to facilitate communication. The various endpoints will provide additional
insight into the current state of the software. The web server that hosts the API is running
on port 5050.
Tools/Material Needed:
1. A computer
2. AQSync Wi-Fi access point login information
a. This can be retrieved from the AQSync software
b. Menu -> System Settings -> Wi-Fi Access Point
3. AQSync IP Address
a. Menu -> System Settings -> About Page
Procedure:
The AQSync API can be accessed through a web browser or by making a get request to
the AQSync.
<AQSync IP Address>:5050/<endpoint>
Example:
192.168.1.145:5050/avg/NOx
Get Average Data - /avg/<device name>
This endpoint can be used to get averaged data from a device in the AQSync. By default, this
endpoint will return a 5-minute average of the last 24 hours of data for the given device.
Additional Arguments
1. startTime
a. This argument can be used to specify the start time of the averaging period
b. Format: yyyy-MM-ddThh:mm:ss
c. Default Value: The current date and time minus one day
2. endTime
a. This argument can be used to specify the end time of the averaging period
b. Format: yyyy-MM-ddThh:mm:ss
c. Default Value: The current date and time
3. avgPeriod
a. This argument can be used to specify the length of the averaging period in
seconds.
b. Default Value: 300 (seconds)
Examples:
1. Get the average data from the NOx device
a. 192.168.1.145:5050/avg/NOx
2. Get average data from the NOx device starting at October 2nd 2024
a. 192.168.1.145:5050/avg/NOx?startTime=2024-08-02T00:00:00
3. Get average data from the NOx device starting at October 2nd 2024 until October
4th 2024 at 12:00:00
a. 192.168.1.145:5050/avg/NOx?startTime=2024-08-
02T00:00:00&endTime=2024-08-04T12:00:00
4. Get hour average data from the NOx device
a. 192.168.1.145:5050/avg/NOx?avgPeriod=60
Get Raw Data - /raw/<device name>
This endpoint can be used to get raw (not averaged) data from a device. By default, this
endpoint will return all raw data for the given device from the last 24 hours.
Additional Arguments
1. date
a. This argument can be used to specify which day to get data from
b. Format: yyyy-MM-dd
c. Default Value: current date
Examples:
1. Get the raw data from the NOx device for the current day
a. 192.168.1.145:5050/raw/NOx
2. Get raw data from the NOx device on October 6th 2024
a. 192.168.1.145:5050/raw/NOx?date=2024-07-31
Get all current data - /data
This endpoint can be used to get a snapshot of all current data measured by the AQSync.
Examples:
1. Default
a. 192.168.1.145:5050/data
Get all current data from a device - /data/<device name>
This endpoint can be used to get a snapshot of all parameters from the specified device.
Examples:
1. Default
a. 192.168.1.145:5050/data/NOx
Get all settings - /settings
This endpoint cab be used to get all settings from the AQSync
Examples:
1. Default
a. 192.168.1.145:5050/settings
Get all settings from a device - /settings/<device name>
This endpoint can be used to get all settings from a device.
Examples:
1. Get all settings from the NOx device
a. 192.168.1.145:5050/settings/NOx
Set setting - /set-setting
This endpoint can be used to change settings in the AQSync.
Arguments:
1. deviceName
a. This argument is used to specify which device contains the setting to
change
2. settingName
a. This argument is used to specify which setting to change
b. Format: “<setting name>”
3. Value
a. This argument is used to specify the new value for the setting
b. Format: “<new value>”
Example:
1. Change the NO Slope in the NOx device
a. 192.168.1.145:5050/set-setting?deviceName?NOx&settingName=”NO
Slope”&value=”1.23”
Upload a new Manifest - /manifest/upload
This endpoint can be used to force the AQSync to upload a new manifest to the 2B
Technologies server.
Example:
1. Default
a. 192.168.1.145:5050/manifest/upload
Report the device manifest – /manifest/read
This endpoint can be used to read the current manifest for the AQSync
Example:
1. Default:
a. 192.168.1.145:5050/manifest/read