Assets API
Assets API provides HTTP API for the end user to read device info.
List Your Devices
GET /assets/v1/devices
Get the list of devices the user has access to.
Request
$ curl http://enapter-gateway.local/api/assets/v1/devices -X GET -G \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-d 'page_token=RW5hcHRlcg==' \
-d 'page_size=10' \
-d 'expand=manifest,properties,connectivity' \
-d 'filter[type_in]=endpoint,ucm'
Path Parameters
page_token
string#Token for the results page. The next page's token can be obtained from the
next_page_token
field. If the token is empty, the first page will be returned.
page_size
integer#Maximum number of results per response page. If omitted, the server chooses the number of results.
expand
array of strings#Comma-separated list of additional device information to display. By default, no additional fields are included.
Supported values:
manifest
— to include device blueprint manifest.properties
— to include the last received device properties.connectivity
— to include current device connection status.
filter
object#A filter expression that filters resources listed in the response. A filter is an object whose keys are a combination of a field name and a predicate separated by underscore (e.g.
type_in
), and whose values are predicate arguments.Currently only filter for the field
type
usingin
predicate is available (argument is comma-separated array of strings).
Response
{
"devices": [
{
"device_id": "123e4567-e89b-12d3-a456-426614174000",
"type": "endpoint",
"updated_at": "2022-01-01T20:22:00Z",
"properties": {
"serial_number": "1XXXX",
"model": "AnySen M12"
},
"connectivity": {
"online": true
},
"manifest": {...}
}
],
"next_page_token": "TmV4dCBQYWdlIFRva2Vu"
}
devices
object#Array of
Device
objects.Device.device_id
string#Device ID.
Device.type
string#Device type. One of:
endpoint
(i.e. your connected device),ucm
(i.e. one of Enapter UCMs),gateway
(i.e. Enapter Gateway).
Device.updated_at
string#The latest update time of the device in RFC 3339 format.
Device.properties
object#The latest device properties. This is an object whose keys and values are properties' names and values respectively. Set only if properties are requested via
expand
parameter.
errors
array of errors#Array of errors. See common error format for more details.
next_page_token
string#Token of the next page. If token is
null
, there are no more pages.