Bulk Renaming Cameras

I was asked to change the retention settings on several hundred cameras. The end-customer had upgraded their internet connection and could now support uploaded video from 16 bridges and 800+ cameras. These were across many sites and they gave me a specific list of bridges that could be upgraded.

Step 1: Login to the Eagle Eye API

The first step in working with our API is to login with your username, password and API key. All requests to our API should include the API key that you created. After the Authentication step, you will get a token which you will then need to pass into the Authorization step. We automatically return you the user information for the user who just logged-in.

Step 2: Get Available Devices

The currently logged-in user is able to get information about what devices they have been given access to. Once you had the cameras you can start the matching process.

Step 3: Iterate Through All The Cameras

Camera settings can be confusing to work with. The core idea is that there are default values and new settings are applied on top of these. This allows the default values to change over time without losing items that have been explicitely set.

You can get all the details here.

Changing the actual camera setting is just updating the values with a POST to `/g/device`. We can build up the update object by creating a blank object named "camera_settings_add" and inside of the another object named "settings". We want to change the "cloud_retention_days" so we will add that as a key and the value will be 60.

Describing code is sometimes confusing so it might be helpful to look at the code sample for this blog post.

What else can we do with this?

This pattern and function can be used to same hours of manually adjust camera settings. It can also be used to audit a site and confirm that it complies with your video retention policy.

I hope you found this helpful. If you have any questions please feel free to reach out to us at api_support@een.com