Difference between revisions of "Sensaphone.net API/dashboard"

From Sensaphone.net
Jump to: navigation, search
(Sensaphone.net API)
(Example)
 
(4 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                  | Integer          | Session ID
+
}}{{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 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          | name                                | Optional    | String    | Name of account holder
+
}}{{TableRowN| dashboard          | online_count                  | Optional    | Integer    | Number of Devices turned on and online
}}{{TableRowN| dashboard          | devices_online                 | Optional    | Integer    | Number of Devices turned on and online
+
}}{{TableRowN| dashboard          | offline_count                 | Optional    | Integer    | Number of Devices offline
}}{{TableRowN| dashboard          |  unacknowledged_alarms   | Optional    | Integer    | Number of unacknowledged alarms
+
}}{{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]]) *Only returns zones with an alarm
 +
}}{{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}}
  
Line 56: Line 68:
  
 
*'''Request JSON'''  
 
*'''Request JSON'''  
{
+
{
     "request_type":"read",
+
     "request_type": "read",
     "resource":"dashboard",
+
     "resource": "dashboard",
     "acctid":987654,
+
     "acctid": 12345678,
     "uuid":"0123-4567-8901",
+
     "session": "123a-456b-789c",
     "devices_online": null,
+
     "dashboard": {
    "device":
+
        "online_count": null,
      {
+
        "device": [{
        "name":null
+
            "name": null
      }
+
        }]
}
+
    }
 +
}
  
 
*'''Result JSON'''
 
*'''Result JSON'''
  
{
+
{
     "result":
+
     "response": {
      {  
+
        "dashboard": {
      "success":true,
+
            "device": [
      "code":0,
+
                {
      "message":"OK:,
+
                    "device_id": 9876,
      },
+
                    "name": "A device"
    "response":  
+
                },
      {
+
                {
        "devices_online":3,
+
                    "device_id": 5432,
        "device":
+
                    "name": "Another device"
            {
+
                }
            "name":"Device 1",
+
            ],
            "name":"Device 2",
+
            "online_count": 2
            "name":"Device 3"
+
        }
            }
+
    },
      }
+
    "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 PropertyChild PropertyType Description
  acctid Integer Account ID
  session String Session ID
  request_type String "read"
  dashboard Object The dashboard object.


JSON Mode Response Properties

Parent PropertyChild PropertyStatus 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
   }

}