get Devices
Get all devices under a registry
Subscription ID
Registry ID
Page Number
The maximum number of devices to return in the response. If this value is zero, the service will select a default size.
The fields of the Device resource to be returned to the response. The fields id and numId are always returned, along with any other fields specified. A comma-separated list of fully qualified names of fields. Example:
A list of device string IDs in array array format. For example, ['device0', 'device12']. If empty, this field is ignored. Maximum IDs: 10,000
A list of device numeric IDs in array format. If empty, this field is ignored. Maximum IDs: 10,000.
If set, returns only the gateways with which the specified device is associated. The device ID can be numeric (num_id) or the user-defined string (id). For example, if 456 is specified, returns only the gateways to which the device with num_id 456 is bound.
If set, only devices associated with the specified gateway are returned. The gateway ID can be numeric (num_id) or the user-defined string (id). For example, if 123 is specified, only devices bound to the gateway with num_id 123 are returned
If GATEWAY is specified, only gateways are returned. If NON_GATEWAY is specified, only non-gateway devices are returned. If GATEWAY_TYPE_UNSPECIFIED is specified, all devices are returned.
OK
Bad Request
Not Found
Internal Server Error
GET /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices HTTP/1.1
Host: api.korewireless.com
Authorization: Bearer YOUR_SECRET_TOKEN
x-api-key: YOUR_API_KEY
Accept: */*
{
"devices": [
{
"id": "text",
"name": "text",
"numId": "text",
"parent": "text",
"registry": "text",
"blocked": true,
"capresent": true,
"subscription": "text",
"createdOn": "text",
"updatedOn": "text",
"credentials": [
{
"expirationTime": "text",
"id": "text",
"publicKey": {
"format": "RSA_PEM",
"key": "text"
}
}
],
"gateway": [
"text"
],
"gatewayConfig": {
"gatewayAuthMethod": "GATEWAY_AUTH_METHOD_UNSPECIFIED",
"gatewayType": "NON_GATEWAY"
},
"isGateway": true,
"deviceErrors": "text",
"clientOnline": true,
"lastConfigAckTime": "text",
"lastConfigSendTime": "text",
"lastErrorStatus": {
"code": 1,
"details": "text",
"message": "text"
},
"lastErrorTime": "text",
"lastEventTime": "text",
"lastHeartbeatTime": "text",
"lastStateTime": "text",
"logLevel": "INFO",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"config": {
"acknowledged": true,
"binaryData": "text",
"cloudUpdateTime": "text",
"deviceAckTime": "text",
"version": 1
},
"state": {
"binaryData": "text",
"updateTime": "text"
},
"policy": {
"Connect": true,
"PublishState": true,
"PublishEvents": true,
"PublishEventsRegex": "text",
"PublishLoopback": true,
"SubscribeCommand": true,
"SubscribeCommandRegex": "text",
"SubscribeBroadcast": true,
"SubscribeBroadcastRegex": "text",
"SubscribeConfig": true
}
}
],
"pageNumber": 1,
"pageSize": 1,
"totalCount": 1
}Authorization: apiKey
name: x-api-key
in: header
type: apiKeycurl -L -X GET 'https://api.korewireless.com/omnicore/subscriptions/:subscriptionId/registries/:registryId/devices' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'x-api-key: <API_KEY_VALUE>'import requests
url = "https://api.korewireless.com/omnicore/subscriptions/:subscriptionId/registries/:registryId/devices"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <TOKEN>',
'x-api-key': '<API_KEY_VALUE>'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.korewireless.com/omnicore/subscriptions/:subscriptionId/registries/:registryId/devices"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Bearer <TOKEN>")
req.Header.Add("x-api-key", "<API_KEY_VALUE>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}const axios = require('axios');
let config = {
method: 'get',
url: 'https://api.korewireless.com/omnicore/subscriptions/:subscriptionId/registries/:registryId/devices',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <TOKEN>',
'x-api-key': '<API_KEY_VALUE>'
}
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});Last updated