Prerequisites:
- Python 3.x installed and set as system variable (if using the built-in python http server as your local web host tool)
- Your preferred JavaScript editor
- Online Nx Witness System you can connect to
- Nx Witness Desktop Client
How to write code and test the integration:
- Create a folder.
- Create an empty index.html file in the folder.
- Open the index.html file in your preferred JavaScript editor and write your code.
- Host the index.html file on a local web server for testing purposes.
a. Open CMD/terminal and navigate to the folder created in step 2.
b. Run the command: python3 -m http.server 7002 - Open Nx Witness Desktop and connect to a System.
- Open Main Menu > New > Web Page
- Enter the URL: https://localhost:7002/index.html
- Go to the Advanced tab and select Allow using Client API.
- Click OK. Afterward, open the web page in the layout.
To see how to use our API to create your desired integration, we wrote an example to demonstrate the following functionality:
- Provide a list of resources on the Nx Witness System that gets updated when a resource is added/removed.
- The ability to select resources (e.g. camera) and enter a timestamp for it to open the archive at that time on the Layout.
- If any errors occur in the above action, the error will be logged in the Nx Witness log and displayed on the web page.
- The ability to set archive playback speed to 2x.
- The ability to save the Layout with a name.
Please visit the GitHub Open Integrations repository to see an example web page built using this API.
Comments
0 comments
Article is closed for comments.