Difference between revisions of "Sensaphone.net API/history"
From Sensaphone.net
(→Sensaphone.net API) |
(→Audit Log) |
||
Line 52: | Line 52: | ||
'''GET''' https://rest.sensaphone.net/api/v1/{ACCOUNT}/{SESSION}/history/audit_log/var_ids/{217744} | '''GET''' https://rest.sensaphone.net/api/v1/{ACCOUNT}/{SESSION}/history/audit_log/var_ids/{217744} | ||
− | == | + | ==Data Log== |
− | Something interesting about | + | Something interesting about data logs... |
− | ''' | + | '''Data Log Filter Options''' |
{{TableStart|border_size=1 | {{TableStart|border_size=1 | ||
}}{{TableRowN| '''Property''' |'''Status''' | '''Type''' | '''Description''' | }}{{TableRowN| '''Property''' |'''Status''' | '''Type''' | '''Description''' | ||
− | }}{{TableRowN| | + | }}{{TableRowN| log_points | Optional | Array of Integer | list of variable ids |
− | }}{{TableRowN| | + | }}{{TableRowN| status | Optional | Array of String | list of AlarmStatus ("normal", "dependency", "alarm") |
− | + | ||
}}{{TableRowN| start | Optional | Integer | the start time (unix time) | }}{{TableRowN| start | Optional | Integer | the start time (unix time) | ||
}}{{TableRowN| end | Optional | Integer | the end time (unix time) | }}{{TableRowN| end | Optional | Integer | the end time (unix time) | ||
Line 69: | Line 68: | ||
===GET=== | ===GET=== | ||
− | ''' | + | '''Data Log Request Properties''' |
{{TableStart|border_size=1 | {{TableStart|border_size=1 | ||
}}{{TableRowN| '''Parent Property''' |'''Child Property'''| '''Type''' | '''Description''' | }}{{TableRowN| '''Parent Property''' |'''Child Property'''| '''Type''' | '''Description''' | ||
Line 76: | Line 75: | ||
}}{{TableRowN| | request_type | String | "read" | }}{{TableRowN| | request_type | String | "read" | ||
}}{{TableRowN| | history | Object | The History object | }}{{TableRowN| | history | Object | The History object | ||
− | }}{{TableRowN| history | | + | }}{{TableRowN| history | data_log | Object | Data Log Filter Options |
}}{{TableEnd}} | }}{{TableEnd}} | ||
− | ''' | + | '''Data Log Response Properties''' |
{{TableStart|border_size=1 | {{TableStart|border_size=1 | ||
}}{{TableRowN| '''Parent Property''' |'''Child Property'''| '''Type''' | '''Description''' | }}{{TableRowN| '''Parent Property''' |'''Child Property'''| '''Type''' | '''Description''' | ||
}}{{TableRowN| | history | Object | The history object | }}{{TableRowN| | history | Object | The history object | ||
− | }}{{TableRowN| history | | + | }}{{TableRowN| history | data_log | Array of Objects | The returned log |
− | }}{{TableRowN| | + | }}{{TableRowN| data_log | record_id | String | The id of the record |
− | }}{{TableRowN| | + | }}{{TableRowN| data_log | value | String | The value of the variable |
− | }}{{TableRowN| | + | }}{{TableRowN| data_log | variable | String | The variable id |
− | }}{{TableRowN| | + | }}{{TableRowN| data_log | is_alarm | String | Is an alarm |
− | }}{{TableRowN| | + | }}{{TableRowN| data_log | epoch | Integer | The epoch time |
}}{{TableRowN| history | audit_log_filter | Object | Audit Log Filter Options (Only returned in V2) | }}{{TableRowN| history | audit_log_filter | Object | Audit Log Filter Options (Only returned in V2) | ||
}}{{TableEnd}} | }}{{TableEnd}} | ||
− | |||
− | |||
− | |||
==Event Log== | ==Event Log== |
Revision as of 12:38, 19 May 2015
Contents
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
Property | Status | 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 Property | Child 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 Property | Child 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}
Data Log
Something interesting about data logs...
Data Log Filter Options
Property | Status | Type | Description |
log_points | Optional | Array of Integer | list of variable ids |
status | Optional | Array of String | list of AlarmStatus ("normal", "dependency", "alarm") |
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
Data Log Request Properties
Parent Property | Child Property | Type | Description |
acctid | Integer | Account ID | |
session | String | Session ID | |
request_type | String | "read" | |
history | Object | The History object | |
history | data_log | Object | Data Log Filter Options |
Data Log Response Properties
Parent Property | Child Property | Type | Description |
history | Object | The history object | |
history | data_log | Array of Objects | The returned log |
data_log | record_id | String | The id of the record |
data_log | value | String | The value of the variable |
data_log | variable | String | The variable id |
data_log | is_alarm | String | Is an alarm |
data_log | epoch | Integer | The epoch time |
history | audit_log_filter | Object | Audit Log Filter Options (Only returned in V2) |
Event Log
Something interesting about event logs...
Event Log Filter Options
Property | Status | 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 Property | Child 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 Property | Child 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}