How to use the API for Nx Witness Ver5.0 (recording start/stop)
AnsweredHi,
I have questions about the API for Nx Witness Ver5.0.
If start/stop recording the device(camera), I understand that use the following the API.
API : Modify Device record (/rest/v1/devices/{id})
body data :
{
"schedule": {
"isEnabled": true or false
}
}
Is this recognition correct ?
If correct, how do save the changed device(camera) settings ?
Is it possible to save the changes with the API?
Best regards,
-
Hello Hiroki Natori san,
Body data you've presented is correct.
To modify camera settings, PATCH /rest/v1/devices/{id} API should be used.
Here is a python code snippet based on this demo code
payload = {"schedule":{"isEnabled": False}}
get_method_header = create_header(primary_token)
system_info = request_api(LOCAL_URL, f'/rest/v1/devices/e3e9a385-7fe0-3ba5-5482-a86cde7faf48',
'PATCH',
verify=False,
headers=get_method_header,
json=payload) -
Hi Andrey,
Thank you for your prompt reply.
Please tell me one thing.I have tried the following step.
1. Prepared the device(camera) that is set to record on the Nx Witness.
-> Confirmed that the recording has started on Nx Witness Client.2. Stopped recording by executing the API(Modify Device record).
-> Confirmed that the recording has stopped on Nx Witness Client.3. Rebooted the device running Nx Witness.
-> Confirmed that recording started after device boots.If a reboot occurs, the setting change in step2 will not be reflected.
Is it possible to save the changes with the API?Best regards,
-
Hello,
3. Rebooted the device running Nx Witness.
-> Confirmed that recording started after device boots.Could not reproduce this on my linux machine.
This should not happen. All the changes made via API are saved to the DB immediately. There is no special API needed for saving.Tell me more about your device and runtime environment, please. HW description, CPU architechture, OS version, VMS build number, disk type (HDD, SDD, internal, external).
Confirmed that recording started after device boots.
How exactly do you determine that: by API response data, by icons in GUI etc.? Could you share a screenshot?
Please sign in to leave a comment.
Comments
3 comments