Is the Nx Cloud up? Visit our Status Page for the current health and performance of the Nx Cloud.

Status Page

How to use the API for Nx Witness Ver5.0 (recording start/stop)

Answered

Comments

3 comments

  • Andrey Terentyev
    • Network Optix team

    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

    https://github.com/networkoptix/nx_open_integrations/blob/master/python/examples/authentication/local_bearer.py

    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)

     

     

    0
  • Hiroki Natori

    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,

    0
  • Andrey Terentyev
    • Network Optix team

    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?

    0

Please sign in to leave a comment.