Get Device Statistics¶
Get the device statistics of an organization or product.
Request Format¶
GET https://{apigw-address}/connect-service/v2.1/devices?action=getStats
Request Parameters (URI)¶
| Name | Location (Path/Query) | Mandatory/Optional | Data Type | Description | 
|---|---|---|---|---|
| orgId | Query | Mandatory | String | The organization ID which the asset belongs to. How to get orgId>> | 
| productKey | Query | Optional | String | The product key. If not specified, the query will return the device statistics under the organization. | 
Response Parameters¶
| Name | Data Type | Description | 
|---|---|---|
| data | DeviceStats Struct | The returned results of the device statistics. For details, see DeviceStats Struct. | 
DeviceStats Struct 
| Name | Data Type | Description | 
|---|---|---|
| totalCount | Integer | The total number of devices. | 
| onlineCount | Integer | The number of online devices. | 
| offlineCount | Integer | The number of offline devices. | 
| inactiveCount | Integer | The number of inactive devices. | 
| disabledCount | Integer | The number of disabled devices. | 
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/devices?action=getStats&orgId=yourOrgId&productKey=yourProductKey
method: GET
Return Sample¶
{
    "code":0,
    "msg":"OK",
    "requestId":"21e4f294-824b-4eb5-913d-2ca92a230a71",
    "data": {
        "totalCount":100,
        "onlineCount":46,
        "offlineCount":24,
        "inactiveCount":26,
        "disabledCount":4
    }
}