Sensaphone.net API/history

From Sensaphone.net
Revision as of 12:23, 19 May 2015 by Tim (Talk | contribs) (Access)

Jump to: navigation, search

Sensaphone.net API

Access

The History API allows access to the Audit Log, the Data Log, and the Event Log

Specifications

The URI Mode for the History API is unique because it allows filtering options to be specified in pairs and can be added in any order. Also, the array values are expressed as a common-separated list.

 /history/audit_log/var_ids/{1234,9876}/changes/{create}

Audit Log

Something interesting about audit logs...

Audit Log Filter Options

PropertyStatus Type Description
var_ids Optional Array of Integer list of variable ids
user_ids Optional Array of Integer list of user ids
changes Optional Array of String list of change types ("create","delete","update")
start Optional Integer the start time (unix time)
end Optional Integer the end time (unix time)
begin_offset Optional Integer the beginning offset of the first record
record_offset Optional Integer the offset from the beginning

GET

Audit Log Request Properties

Parent PropertyChild Property Type Description
  acctid Integer Account ID
  session String Session ID
  request_type String "read"
  history Object The History object
history audit_log Object Audit Log Filter Options

Audit Log Response Properties

Parent PropertyChild Property Type Description
  history Object The history object
history audit_log Array of Objects The returned log
audit_log change String The change that occurred
audit_log who String Who changed it
audit_log what String What changed
audit_log when String When it changed
audit_log epoch Integer The epoch time
history audit_log_filter Object Audit Log Filter Options (Only returned in V2)
  • Receive all "Unacknowledged Alarms" changes:
 GET https://rest.sensaphone.net/api/v1/{ACCOUNT}/{SESSION}/history/audit_log/var_ids/{217744}

Event Log

Something interesting about event logs...

Event Log Filter Options

PropertyStatus Type Description
contact_ids Optional Array of Integer list of contact ids
device_ids Optional Array of Integer list of device ids
zone_ids Optional Array of Integer list of zone ids
user_ids Optional Array of Integer list of user ids
event_types Optional Array of String list of event types
start Optional Integer the start time (unix time)
end Optional Integer the end time (unix time)
begin_offset Optional Integer the beginning offset of the first record
record_offset Optional Integer the offset from the beginning

GET

Event Log Request Properties

Parent PropertyChild Property Type Description
  acctid Integer Account ID
  session String Session ID
  request_type String "read"
  history Object The History object
history event_log Object Event Log Filter Options

Event Log Response Properties

Parent PropertyChild Property Type Description
  history Object The history object
history event_log Array of Objects The returned log
event_log event String Which event
event_log when String When it changed
event_log epoch Integer The epoch time
event_log type String The type
event_log source Object The sources of the event
source <source_name> String A source
history event_log_filter Object Event Log Filter Options (Only returned in V2)
  • Receive all "Alarms Events":
 GET https://rest.sensaphone.net/api/v1/{ACCOUNT}/{SESSION}/history/event_log/type/{alarm}