Enable/Disable Recording via Nx Server API
Nx Witness doesn't have direct API method to start or stop recording on certain cameras. But there is one called "saveCameraUserAttributes" that can change the additional attributes of a specific camera. So we can use this API to enable or disable the recording schedule; in other words, start/stop recording. (Nx Server API)
How To Steps:
- Get the camera's full parameter list JSON through /ec2/getCamerasEx
- Extract the parameter, id. (#Notice : Not physicalId.) Since 3.0 it's possible to get camera id directly from Nx Witness Client. You can find it at "Camera Settings" -> "Advanced" tab.
- Use the id as index, construct the JSON with required parameters of /ec2/saveCameraAttributes, you can refer to the API document.
- Change the parameter - scheduledEnabled to enable/disable the recording of camera. True is enabled ;False is disabled.
- Send POST request to Nx Media Server, using the API /ec2/saveCameraAttributes.
All requests to the Nx Media Server are required provided correct user authentication. Nx Media Server supports HTTP basic and digest authentication.
- Digest is more secured, workflow is described in the API documentation.
- Basic is much simpler to use, just add user login and password to the link.
You can download the sample code for further detail. Shall you have any question, please go to our support system.