Skip to content

Instantly share code, notes, and snippets.

@pliablepixels
Created February 11, 2020 20:41
Show Gist options
  • Save pliablepixels/c30bef6704008c3230faefbdb11e4be8 to your computer and use it in GitHub Desktop.
Save pliablepixels/c30bef6704008c3230faefbdb11e4be8 to your computer and use it in GitHub Desktop.
import pyzm.api as zmapi
api_options = {
'apiurl': 'https://yourserver/zm/api',
'portalurl': 'https://yourserver/zm',
'user': 'admin',
'password': 'password',
'logger': None # use none if you don't want to log to ZM
}
zmapi = zmapi.ZMApi(options=api_options)
event_filter = {
'from': '1 day ago', # this will use localtimezone, use 'tz' for other timezones
'object_only':True,
}
events = zmapi.events(event_filter)
for e in events.list():
print ('Monitor:{} Event:{} Notes:{} Detected Frame URL:{}'.format(e.monitor_id(),e.id(),e.notes(), e.get_image_url(fid='objdetect')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment