How to test API Integration with third-party apps
The purpose of this test is to verify that the Broox products, specifically the Vision Node and the Controller, are functioning correctly in terms of communication through the API. The goal is to ensure that the Vision Node can analyze a video, detect relevant information (such as the number of people), and send this data accurately to the cloud through the API.
The steps outlined below will guide developers in configuring the required files, running the tests, and verifying the communication of data between the Broox Vision Node and the Broox Test App.
This test is essential to validate that the integration with the API is working correctly, allowing the Vision Node to receive accurate data about the video content and send it for further analysis.
Key Steps of the Test:
-
Environment Setup: Configuring the necessary license, calibration, and configuration files to ensure the Vision Node operates correctly.
-
Running the Test: Loading the test files and executing the Vision Node with a predefined video, while monitoring the communication in real-time using the Broox Test App.
-
Results Verification: Checking that the data sent by the Vision Node (such as the number of people detected) matches the values defined in the groundtruth.txt file, ensuring API accuracy.
This verification process is crucial to ensure that Broox products are correctly configured and capable of sending accurate data through the API for further analysis and processing.
Environment Setup
Requiered Software
- Controller
- Vision node
- Broox Test App - Support
Required Files:
The necessary files are as follows:
- API-TEST.license
- Video.mp4
- groundtruth.txt
- calibration.txt
- visionnode.ini
Download the files and store them wherever you consider better.
- File Descriptions:
Licensce
- The license file configures the Controller and helps quickly locate output data.
It must be loaded on the Controller with the 'Read .license file' button
Video
- The file that the Vision Node will analyze.
groundtruth.txt
- This file contains the actual data for the video. It specifies how many people the Vision Node should detect and communicate.
calibration.txt
-
This file contains the camera calibration data (intrinsic and extrinsic) for the video. It is essential for the Vision Node to function properly.
-
This file must be copied to the following path:
C:\Users\
\AppData\Local\Broox Vision Node\Broox Vision Node
visionnode.ini
-
This file contains all the configuration settings for the Vision Node to run the test efficiently.
-
It must be copied to the following path:
C:\Users\
\AppData\Local\Broox Vision Node\Broox Vision Node
Running the test
Condigurations
Step 1: Configuring the Controller
-
Open the Controller.
-
Load the .license file using the Read .license file button.
-
Run the Controller.
Step 2: Configuring the Vision Node
- Copy the calibration.txt and visionnode.ini files to the following path:
C:\Users\
\AppData\Local\Broox Vision Node\Broox Vision Node
Step 3: Configuring the Broox Test App
-
Open the Config tab in the Analytics section and fill in the following fields:
-
Host: broox-studio-staging
- Account ID: -NxvZuBh8xwrqF-yAbRh
- Account API Key: ef9a14a0-df71-4416-a5bc-5a95c4b8d17c
Note: The data provided here is an example. To configure the test with your own instance, follow these steps:
Obtaining the Host:
- The Host field is broox-studio-analytics
Obtaining the Account ID and API Key:
The Account ID and Account API Key are specific to your account and are used for authentication when interacting with Broox's services. To find them:
Navigate to the Account list on your Broox studio instance.
Locate the account you want to use for this test, then click the pencil and paper icon (edit icon) next to it to open the account settings.
In the opened window, look for the fields labeled ID and API KEY.
Copy the value from the ID field to populate the Account ID field.
Copy the value from the API KEY field to populate the Account API Key field.
This will ensure that you are using the correct credentials for your account when configuring the test.
- In the Config tab, under the Stage section, fill in the MQTT Address field with:
mqtt://127.0.0.1
- Save the configuration by clicking the Save button.
- Go to the Stage tab and select MQTT to view any messages.
Step 4: Test Execution 1. Open Command Prompt: - Press the Windows key + R. - Type cmd* and press Enter**.
-
Change directory to the Vision Node’s installation folder: > cd C:\Program Files (x86)\Broox Vision Node
-
Run the test with the following command:
Type: BrooxVisionNode.exe -d -i -f
-P traffic-measure.yml -C -
During the test, you can monitor the messages the Vision Node is sending to the cloud in the Broox Test App.
Results Verification
-
In the Broox Test App, go to the Analytics section.
-
Select the getTotalAudience method.
-
Apply the following filters:
-
From = 'Today'
-
To = 'Today'
-
-
Click on fetch Button.
-
Verify that the count displayed in the Broox Test App matches the count from the groundtruth.txt file.
Depending on the test run, the count may be off by 1 (either up or down) compared to the groundtruth.txt file.