Nx Witness does hot have a direct API method to start or stop recording on specific cameras. There is ah API called "saveCameraUserAttributes" that can change the additional attributes of a specific camera. We can use this API to enable or disable the recording schedule to effectivly start and stop recording.
Visit the Server API page for more information.
How To enable and disable recording via Server API
-
- Go to Camera Settings > General tab, click More Info to expand the section.
- Extract the Camera ID.
- Go to Camera Settings > Recording tab, enabling Recording and setting the schedule to always recording.
- Send the Modify Device API PATCH /rest/v3/devices/{id} request to enable/disable recording with the following JSON content.
(Replace the {id} within the API URI with the Camera ID extracted in step 2.)
Unset
- Enable Recording:
{
"schedule": {
"isEnabled": true
}
}
- Disable Recording:
{
"schedule": {
"isEnabled": true
}
}
Note: You may use the Get Devices API GET /rest/v3/devices/?_with=id,name to get the camera ID and name from all the cameras at once.
Authentication
All requests to the Server application are required to provide correct user authentication. The Server supports two types of HTTP authentication: basic and digest.
- Digest is more secure, the workflow is described in the API documentation.
- Basic is much simpler to use, just add user login and password to the link.
For more information, refer to this article.
Comments
0 comments
Article is closed for comments.