Get Device Events
Retrieves detailed information about device events, specifically tracking attach and detach actions. This feature allows you to monitor when devices are connected or disconnected, providing valuable insights into routine usage patterns and unexpected changes. By accessing this data, you can efficiently troubleshoot connection issues, ensure smooth device operation, and maintain an accurate record of device activity.
Syntax: see Call Structure
Type = 'GET'
'http://localhost:43426/api/v1/devices/usb-serial/events?start=start-time&end=end-time&limit=max-limit&offset=offset' \ |
Variable | Description |
---|---|
usb-serial | USB serial number |
start-time | The start time of the query. If not specified, the start time is the beginning of time. |
end-time | The end time of the query. If not specified, the end time is the current time. |
max-limit | The maximum number of records to return. If not specified, the default is all. |
offset | The offset into the result set. If not specified, the default is 0. |
Returns:
{ "_metadata": { "offset": offset, "limit": max-limit, "total": total-results, "links": { "self": "search" } }, "result": { "entries": [ { "timestamp": event-time, "event": "event-description", "port": { "hub": { "id": "hub-serial" }, "index": port-number } } ], "devices": [ { "id": "usb-serial", "manufacturer": "device-manufacturer", "description": "description", "vid": Vendor-ID, "pid": product-ID } ] } } |
Variable | Description |
---|---|
offset | The offset into the result set. If not specified, the default is 0. |
max-limit | The maximum number of records to return. If not specified, the default is all. |
total-results | The amount of results that have been returned |
search | The search string |
event-time | The hub time the event took place in ms, shown as an integer |
event-description | A description of the event that took place |
hub-serial | The hub serial number |
port-number | The number of the port on the hub |
usb-serial | USB serial number |
device-manufacturer | The name of the device manufacturer |
description | Name of the hardware |
Vendor-ID | Device Vedor ID number or VID. Displayed as an Integer |
product-ID | Product ID number or PID. Displayed as an Integer |
Example
curl -X 'GET' \
'http://localhost:43426/api/v1/devices/1/events?start=0&end=0&limit=10&offset=0' \
-H 'accept: application/json'
Returns
{
"_metadata": {
"offset": 0,
"limit": 10,
"total": 1,
"links": {
"self": "/api/v1/devices/E/events?start=0&end=0&limit=10& offset=0/api/v1/devices/00008101000E19012282001E/events?start=0&end=0&limit =10&offset=0"
}
},
"result": {
"entries": [
{
"timestamp": 1726064750000,
"event": "usb-device-attached",
"port": {
"hub": {
"id": "000098"
},
"index": 11
}
}
],
"device": {
"id": "E",
"vid": 12,
"pid": 6,
"manufacturer": "Apple Inc.",
"description": "iPhone",
"system": {
"name": "test’s iPhone",
"serialNumber": "F1P"
}
}
}
}
Errors
If there is an error in the API method then JSON-RPC Error Object a will be returned