Difference between revisions of "Sensaphone.net API/dashboard"
From Sensaphone.net
								
												
				 (→Sensaphone.net API)  | 
				 (→GET)  | 
				||
| Line 34: | Line 34: | ||
}}{{TableRowN| '''Parent Property''' |'''Child Property'''|'''Status'''| '''Type'''       | '''Description'''  | }}{{TableRowN| '''Parent Property''' |'''Child Property'''|'''Status'''| '''Type'''       | '''Description'''  | ||
}}{{TableRowN|                  | dashboard             | Required   | Object | The dashboard object.  | }}{{TableRowN|                  | dashboard             | Required   | Object | The dashboard object.  | ||
| − | }}{{TableRowN| dashboard           |   | + | }}{{TableRowN| dashboard           | online_count                  | Optional    | Integer    | Number of Devices turned on and online  | 
| − | }}{{TableRowN| dashboard           |   | + | }}{{TableRowN| dashboard           | offline_count                  | Optional    | Integer    | Number of Devices offline  | 
| − | }}{{TableRowN| dashboard           |    | + | }}{{TableRowN| dashboard           |  alarm_count   | Optional    | Integer    | Number of acknowledged alarms  | 
| + | }}{{TableRowN| dashboard           |  unack_count   | Optional    | Integer    | Number of unacknowledged alarms  | ||
| + | }}{{TableRowN| dashboard           |  total_alarm_count   | Optional    | Integer    | Number of alarms  | ||
}}{{TableRowN| dashboard           |  device                              | Optional     | Array      | Array of Devices  | }}{{TableRowN| dashboard           |  device                              | Optional     | Array      | Array of Devices  | ||
}}{{TableRowN| device                | device_id          | Optional   | Integer          | ID of Device  | }}{{TableRowN| device                | device_id          | Optional   | Integer          | ID of Device  | ||
}}{{TableRowN| device                | id                 | Optional   | Integer          | Unique identifier located on the Device (Serial number, etc.)  | }}{{TableRowN| device                | id                 | Optional   | Integer          | Unique identifier located on the Device (Serial number, etc.)  | ||
}}{{TableRowN| device                | name               | Optional   | String           | Name of Device  | }}{{TableRowN| device                | name               | Optional   | String           | Name of Device  | ||
| + | }}{{TableRowN| device                | location           | Optional   | Object           | Contains location information for the device.  | ||
| + | }}{{TableRowN| location              | address            | Optional   | Object           |  Address information for Device (See [[Sensaphone.net API/address]])  | ||
| + | }}{{TableRowN| location              | coordinates        | Optional   | Object           |  GPS Coordinates information for Device (See [[Sensaphone.net API/coordinates]])  | ||
}}{{TableRowN| device                | status        | Optional   | String           | Alarm status of Device("OK" or "Alarm")  | }}{{TableRowN| device                | status        | Optional   | String           | Alarm status of Device("OK" or "Alarm")  | ||
}}{{TableRowN| device                | is_offline_unack   | Optional   | Boolean          | Whether or not an '''unacknowledged''' offline alarm exists.  | }}{{TableRowN| device                | is_offline_unack   | Optional   | Boolean          | Whether or not an '''unacknowledged''' offline alarm exists.  | ||
| Line 49: | Line 54: | ||
}}{{TableRowN| device                | power_value    | Optional       | String    | A device's power value      | }}{{TableRowN| device                | power_value    | Optional       | String    | A device's power value      | ||
}}{{TableRowN| device                | connection_status    | Optional       | String    | A device's connection status      | }}{{TableRowN| device                | connection_status    | Optional       | String    | A device's connection status      | ||
| + | }}{{TableRowN| device                | zone               | Optional   | Array of Objects | Device Zone data (See [[Sensaphone.net API/zone|Sensaphone.net API/zone]])  | ||
| + | }}{{TableRowN| zone                  | canonical_name        | Optional   | String  | Canonical name of the zone.  | ||
| + | }}{{TableRowN| zone                  | value              | Optional   | String           | The data value for the zone.  | ||
| + | }}{{TableRowN| zone                  | type               | Optional   | String           | The zone type.  | ||
| + | }}{{TableRowN| zone                  | alarm_zone         | Optional   | Object           | Sub-object containing data for alarmable zones. 'null' if unsupported.  | ||
| + | }}{{TableRowN| alarm_zone            | alarm_status         | Optional   | Array of ZoneState          |   The processed status of the zone ( returns 2 ZoneStates)  | ||
| + | }}{{TableRowN| alarm_zone            | unack_alarms         | Optional   | Array of ZoneState          |  Alarm states that are currently unacknowledged   | ||
}}{{TableEnd}}  | }}{{TableEnd}}  | ||
Revision as of 12:15, 30 April 2015
Sensaphone.net API
Receive data to populate Dashboard. The Dashboard is a page that gives the user a quick view of Device and alarm statuses. It is a read only resource.
Example Call
http://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/dashboard
Example Requests
GET
URI Mode Request URI's:
- Receive all Dashboard information
 
GET https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/dashboard
- Receive for the number of Devices online
 
GET https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/dashboard/devices_online
- Receive the names of all Devices powered on and online
 
GET https://rest.sensaphone.net/api/v1/{ACCTID}/{UUID}/dashboard/device/name
JSON Mode Request URI:
POST https://rest.sensaphone.net/api/v1/dashboard
JSON Mode Request Properties
| Parent Property | Child Property | Type | Description | 
| acctid | Integer | Account ID | |
| session | Integer | Session ID | |
| request_type | String | "read" | |
| dashboard | Object | The dashboard object. | 
JSON Mode Response Properties
| Parent Property | Child Property | Status | Type | Description | 
| dashboard | Required | Object | The dashboard object. | |
| dashboard | online_count | Optional | Integer | Number of Devices turned on and online | 
| dashboard | offline_count | Optional | Integer | Number of Devices offline | 
| dashboard | alarm_count | Optional | Integer | Number of acknowledged alarms | 
| dashboard | unack_count | Optional | Integer | Number of unacknowledged alarms | 
| dashboard | total_alarm_count | Optional | Integer | Number of alarms | 
| dashboard | device | Optional | Array | Array of Devices | 
| device | device_id | Optional | Integer | ID of Device | 
| device | id | Optional | Integer | Unique identifier located on the Device (Serial number, etc.) | 
| device | name | Optional | String | Name of Device | 
| device | location | Optional | Object | Contains location information for the device. | 
| location | address | Optional | Object | Address information for Device (See Sensaphone.net API/address) | 
| location | coordinates | Optional | Object | GPS Coordinates information for Device (See Sensaphone.net API/coordinates) | 
| device | status | Optional | String | Alarm status of Device("OK" or "Alarm") | 
| device | is_offline_unack | Optional | Boolean | Whether or not an unacknowledged offline alarm exists. | 
| device | is_online | Optional | Boolean | Whether or not the device is currently online. | 
| device | battery_status | Optional | String | A device's battery status | 
| device | power_status | Optional | String | A device's power status | 
| device | battery_value | Optional | String | A device's battery value | 
| device | power_value | Optional | String | A device's power value | 
| device | connection_status | Optional | String | A device's connection status | 
| device | zone | Optional | Array of Objects | Device Zone data (See Sensaphone.net API/zone) | 
| zone | canonical_name | Optional | String | Canonical name of the zone. | 
| zone | value | Optional | String | The data value for the zone. | 
| zone | type | Optional | String | The zone type. | 
| zone | alarm_zone | Optional | Object | Sub-object containing data for alarmable zones. 'null' if unsupported. | 
| alarm_zone | alarm_status | Optional | Array of ZoneState | The processed status of the zone ( returns 2 ZoneStates) | 
| alarm_zone | unack_alarms | Optional | Array of ZoneState | Alarm states that are currently unacknowledged | 
Example
This example is requesting the devices_online and name values.
- Request JSON
 
{
   "request_type":"read",
   "resource":"dashboard",
   "acctid":987654,
   "uuid":"0123-4567-8901",
   "devices_online": null,
   "device":
     {
       "name":null
     }
}
- Result JSON
 
{
   "result":
     { 
      "success":true,
      "code":0,
      "message":"OK:,
     },
    "response": 
     { 
       "devices_online":3,
       "device":
           {
            "name":"Device 1",
            "name":"Device 2",
            "name":"Device 3"
           }
     }
}