Difference between revisions of "Sensaphone.net API/dashboard"
From Sensaphone.net
								
												
				 (→Example)  | 
				 (→Example)  | 
				||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 25: | Line 25: | ||
}}{{TableRowN| '''Parent Property'''|'''Child Property''' |'''Type'''        | '''Description'''  | }}{{TableRowN| '''Parent Property'''|'''Child Property''' |'''Type'''        | '''Description'''  | ||
}}{{TableRowN|            | acctid                   | Integer          | Account ID  | }}{{TableRowN|            | acctid                   | Integer          | Account ID  | ||
| − | }}{{TableRowN|            | session                  |   | + | }}{{TableRowN|            | session                  | String           | Session ID  | 
}}{{TableRowN|            | request_type             | String           | "read"  | }}{{TableRowN|            | request_type             | String           | "read"  | ||
}}{{TableRowN|            | dashboard                   | Object | The dashboard object.  | }}{{TableRowN|            | dashboard                   | Object | The dashboard object.  | ||
| Line 54: | 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| device                | zone               | Optional   | Array of Objects | Device Zone data (See [[Sensaphone.net API/zone|Sensaphone.net API/zone]]) *Only returns zones with an alarm  | 
}}{{TableRowN| zone                  | canonical_name        | Optional   | String  | Canonical name of the 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                  | value              | Optional   | String           | The data value for the zone.  | ||
| Line 68: | Line 68: | ||
*'''Request JSON'''    | *'''Request JSON'''    | ||
| − | + | {  | |
| − |      "request_type":"read",  | + |      "request_type": "read",  | 
| − |      "resource":"dashboard",  | + |      "resource": "dashboard",  | 
| − |      "acctid":  | + |      "acctid": 12345678,  | 
| − |      "session":"  | + |      "session": "123a-456b-789c",  | 
| − |      "online_count": null,  | + |      "dashboard": {  | 
| − | + |         "online_count": null,  | |
| − | + |         "device": [{  | |
| − | + |             "name": null  | |
| − | + |         }]  | |
| − | + |     }  | |
| + | }  | ||
*'''Result JSON'''  | *'''Result JSON'''  | ||
| − | + | {  | |
| − |      "  | + |      "response": {  | 
| − | + |         "dashboard": {  | |
| − | + |             "device": [  | |
| − | + |                 {  | |
| − | + |                     "device_id": 9876,  | |
| − | + |                     "name": "A device"  | |
| − | + |                 },  | |
| − | + |                 {  | |
| − | + |                     "device_id": 5432,  | |
| − | + |                     "name": "Another device"  | |
| − | + |                 }  | |
| − | + |             ],  | |
| − | + |             "online_count": 2  | |
| − | + |         }  | |
| − | + |     },  | |
| − | + |     "result": {  | |
| − | + |         "code": 0,  | |
| + |         "message": "OK",  | ||
| + |         "success": true  | ||
| + |     }  | ||
| + | }  | ||
Latest revision as of 16:14, 7 September 2017
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 | String | 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) *Only returns zones with an alarm | 
| 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": 12345678,
   "session": "123a-456b-789c",
   "dashboard": {
       "online_count": null,
       "device": [{
           "name": null
       }]
   }
}
- Result JSON
 
{
   "response": {
       "dashboard": {
           "device": [
               {
                   "device_id": 9876,
                   "name": "A device"
               },
               {
                   "device_id": 5432,
                   "name": "Another device"
               }
           ],
           "online_count": 2
       }
   },
   "result": {
       "code": 0,
       "message": "OK",
       "success": true
   }
}