Skip to content

Instantly share code, notes, and snippets.

@foxwill
Last active May 10, 2016 17:57
Show Gist options
  • Save foxwill/f37190e8509d5af5bc51d62e598cdf21 to your computer and use it in GitHub Desktop.
Save foxwill/f37190e8509d5af5bc51d62e598cdf21 to your computer and use it in GitHub Desktop.
Get events by event type using an array of event types to retrieve
import onelogin
# specify client_id, client_secret, and shard (us or eu)
creds = {'client_id':'',
'client_secret':'',
'shard':''}
token = onelogin.Token(**creds)
# Create the events object with the token
onelogin_events = onelogin.Events(token)
# list the event types
events = [147, 148, 149, 150, 151, 152]
each = 0
while each <= len(events):
event_type = each
print "==========RESULT============"
print "======EVENT TYPE: %d======" % events[event_type]
print onelogin_events.search(**{'since':'2016-05-01T00:00:00.681Z', 'event_type_id':'%d' % (events[event_type])})
each += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment