get https://ioe.droplit.io/v0/api/devices//history
Details
View the action history of a device.
The action history records the following types of events.
- Changed: A property changed event, which can be spawned explicitly by the user or implicitly by the system.
- Error: An error event, which spawns when an error occurs pertaining to a device.
- Event: A service event, triggered by device service class(es).
- Get: An event triggered when the “refresh” flag is used to get the most current (not cached) value of a device property.
- Info: An event triggered when the user retrieves the cached value of a device property.
- Set: An event triggered when the user explicitly sets a device property.
An account token, server token, or user token may be used to run this endpoint.
Parameters
path
- id (required): The ID of the device.
query
- continuationCount (optional): The page to read in the action history.
- continuationToken (optional): A system-generated token representing the page start.
- endDate (optional): The latest ISO 8601 datetime that should be included in the action history.
- index (optional): The index of a specific service to include in the action history.
- member (optional): The specific service member to include in the action history.
- pageSize (optional): The number of results that should be displayed per page of the action history.
- service (optional): The name of the service from which to get the action history.
- startDate (optional): The earliest ISO 8601 datetime that should be included in the action history.
- type (optional): The action type to view in the action history.
Responses
200
{
"deviceId": "DEVICE-ID",
"environmentId": "ENVIRONMENT-ID",
"member": "SERVICE-MEMBER-NAME",
"recordKey": "INTERNAL-RECORD-KEY",
"service": "SERVICE-NAME",
"time": "DATE-TIME-MODIFIED YYYY-MM-DD HH:MM:SS ENCODED",
"type": "ACTION-TYPE",
"value": "MEMBER-VALUE"
}
400
- Device Invalid: The standard error structure defines this error as invalid parameters, with an invalid ID. In this context, it means that the ID given for a client is invalid.
- History Continuation Count Invalid: The standard error structure defines this error as invalid parameters. In this context, it means that the continuation count is invalid because it was supposed to be a positive number.
- History End Date Invalid: The standard error structure defines this error as invalid parameters. In this context, it means that the end date for which to stop retrieving history records is incorrectly formatted, and needs to be in valid ISO 8601 datetime format.
- History Event Type Invalid: The standard error structure defines this error as invalid parameters and an invalid value. In this context, it means that the value given to the “type” flag is not valid, and cannot be used to filter history events.
- History Page Size Invalid: The standard error structure defines this error as invalid parameters. In this context, it means that the page size for viewing history records is invalid because it was supposed to be a positive number.
- History Start Date Invalid: The standard error structure defines this error as invalid parameters. In this context, it means that the begin date for which to start retrieving history records is incorrectly formatted, and needs to be in valid ISO 8601 datetime format.
- History Service Index Invalid: The standard error structure defines this error as invalid parameters. In this context, it means that the service index is invalid because it was supposed to be a non-negative number.
- Query Field Not Allowed: The standard error structure defines this error as invalid parameters, with additional parameters in the query string. In this context, it means that one or more query string fields are incorrect. They do not match the name(s) of the query string field(s) that are allowed for this endpoint.
404
- Device Not Found: This error means that a device with the given ID was not found. This is distinct from an invalid device ID being specified; this means that the device ID once existed, but no longer does.
Examples
HTTP
GET https://ioe.droplit.io/api/devices/DEVICE-ID/history HTTP/1.1
authorization: TOKEN
Droplit Console
droplit device history DEVICE-ID
Droplit SDK
droplit.devices.history("DEVICE-ID", CONTINUATION-COUNT, PAGE-SIZE, "CONTINUATION-TOKEN", START-DATE, END-DATE, "SERVICE", "INDEX", "MEMBER", "TYPE");
NOTE
To ignore an optional parameter when calling the function, put
undefined
in its place.