{"_id":"582e8ace1a6d730f0056fdb2","user":"573b7f42fdc9d320001b777d","version":{"_id":"582789aabe5c080f00a5a7fe","__v":10,"project":"568bdc1483d2061900d86cdc","createdAt":"2016-11-12T21:29:14.915Z","releaseDate":"2016-11-12T21:29:14.915Z","categories":["582789abbe5c080f00a5a7ff","582789abbe5c080f00a5a800","582789abbe5c080f00a5a801","582789abbe5c080f00a5a802","582789abbe5c080f00a5a803","582789abbe5c080f00a5a804","582789abbe5c080f00a5a805","582789abbe5c080f00a5a806","582789abbe5c080f00a5a807","582789abbe5c080f00a5a808","5827ea984ca29e0f00137a9e","583df597887db62f00644283","583df5d9c622791900e78da5","5845cd8763c11b250037967d","5845d13063c11b2500379681","5859e859e3306d1900126725","587aeb9a01cf3a0f008359eb","587c422af45e2d0f005e200d","587d84dc82f6f30f004ceee5"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta2","version_clean":"0.0.0","version":"0"},"__v":2,"parentDoc":null,"project":"568bdc1483d2061900d86cdc","category":{"_id":"582789abbe5c080f00a5a803","__v":0,"version":"582789aabe5c080f00a5a7fe","project":"568bdc1483d2061900d86cdc","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-05T15:14:04.838Z","from_sync":false,"order":9,"slug":"something","title":"Devices"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-18T04:59:58.506Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"572c39957c8eff0e00aaa18b","examples":{"codes":[{"code":"GET https://ioe.droplit.io/api/devices/D573bc694ae9ac9419f028b61/history?startDate=2016-12-13T03:53:15.399Z&service=BinarySwitch&member=switch&type=changed HTTP/1.1\nauthorization: AUTH_TOKEN","language":"http"}]},"method":"get","results":{"codes":[{"name":"","code":"{\n    \"items\": [\n        {\n            \"deviceId\": \"D573bc694ae9ac9419f028b61\",\n            \"environmentId\": \"E573bb9ffd717111220812c3a\",\n            \"index\": \"0\",\n            \"member\": \"switch\",\n            \"packetId\": 96,\n            \"service\": \"BinarySwitch\",\n            \"time\": \"2016-12-13T21:53:55.763Z\",\n            \"transactionId\": \"58506df2ff965d3e01ffa073\",\n            \"type\": \"changed\",\n            \"value\": \"on\",\n            \"recordKey\": \"eventsC573b86eeee43dd7ba0244f8a;573bb9ffd717111220812c3a;90057175887065172ff965d3e01ffa074\"\n        },\n        {\n            \"deviceId\": \"D573bc694ae9ac9419f028b61\",\n            \"environmentId\": \"E573bb9ffd717111220812c3a\",\n            \"index\": \"0\",\n            \"member\": \"switch\",\n            \"packetId\": 47,\n            \"service\": \"BinarySwitch\",\n            \"time\": \"2016-12-13T05:43:53.761Z\",\n            \"transactionId\": \"584f8a98ff965d3e01ff9fee\",\n            \"type\": \"changed\",\n            \"value\": \"off\",\n            \"recordKey\": \"eventsC573b86eeee43dd7ba0244f8a;573bb9ffd717111220812c3a;90057176469082368ff965d3e01ff9fef\"\n        },\n        {\n            \"deviceId\": \"D573bc694ae9ac9419f028b61\",\n            \"environmentId\": \"E573bb9ffd717111220812c3a\",\n            \"index\": \"0\",\n            \"member\": \"switch\",\n            \"packetId\": 31,\n            \"service\": \"BinarySwitch\",\n            \"time\": \"2016-12-13T03:53:15.399Z\",\n            \"transactionId\": \"584f70acff965d3e01ff9faf\",\n            \"type\": \"changed\",\n            \"value\": \"on\",\n            \"recordKey\": \"eventsC573b86eeee43dd7ba0244f8a;573bb9ffd717111220812c3a;9005717653544560cff965d3e01ff9fb3\"\n        }\n    ]\n}","language":"json","status":200},{"code":"{\n  \"errorType\": \"InvalidParams\",\n  \"errors\": [\n    {\n      \"in\": \"query\",\n      \"message\": \"Must be a valid ISO 8601 string time\",\n      \"path\": \"startDate\"\n    }\n  ]\n}","language":"json","status":400,"name":""},{"status":401,"code":"","language":"text"},{"language":"text","status":403,"code":""},{"code":"Device with id D573bc694ae9ac9419f028b62 does not exist.","language":"text","status":404}]},"auth":"required","params":[{"_id":"583f9c8100a9f10f00a34e3f","ref":"","in":"path","required":true,"desc":"[device](doc:devices) id","default":"","type":"string","name":"id"},{"_id":"583f9c8100a9f10f00a34e3e","ref":"","in":"query","required":false,"desc":"A system-generated token representing the page start","default":"","type":"string","name":"continuationToken"},{"_id":"583f9c8100a9f10f00a34e3d","ref":"","in":"query","required":false,"desc":"Constrain query to events before the specified ISO 8601 date time","default":"","type":"datetime","name":"endDate"},{"_id":"5850ac1c5dbf4d0f00652284","ref":"","in":"query","required":false,"desc":"Constrain query to services on a specified index","default":"","type":"int","name":"index"},{"_id":"5850ac1c5dbf4d0f00652283","ref":"","in":"query","required":false,"desc":"Constrain query to a specified service member","default":"","type":"string","name":"member"},{"_id":"583f9c8100a9f10f00a34e3c","ref":"","in":"query","required":false,"desc":"Number of results per page","default":"50","type":"int","name":"pageSize"},{"_id":"5850ac1c5dbf4d0f00652282","ref":"","in":"query","required":false,"desc":"Constrain query to services of a specified name","default":"","type":"string","name":"service"},{"_id":"583f9c8100a9f10f00a34e3b","ref":"","in":"query","required":false,"desc":"Constrain query to events after the specified ISO 8601 date time","default":"","type":"datetime","name":"startDate"},{"_id":"583f9c8100a9f10f00a34e3a","ref":"","in":"query","required":false,"desc":"Constrain returned device action to the specified action type (_changed_, _event_, _get_, and _set_)","default":"","type":"string","name":"type"}],"url":"/devices/:id/history"},"isReference":true,"order":5,"body":"History is used to get a history of device actions. These actions may be filtered based on the supplied parameters.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Parameter notes\"\n}\n[/block]\n## continuation token\nContinuation tokens are used in order to get the next page when a query has paginated data. The user is not expected to arbitrarily fill in the token; rather, an endpoint with the token prefilled in is provided on the query results under the `next` property.\n\n## Date/Time filter\nThe results may be filtered to be within a specified date/time range using the `startDate` and/or `endDate` parameter. The date/times are formatted in the ISO 8601 date format. Note: the date/times are filtered based on when the server logged the event which _may_ be a after the time that the event happened.\n\n## Type\nThe type of the event. The types are:\n\n### Changed\nA property changed event. Property changed events are not limited to explicit set commands issued by a user.\n\n### Event\nA service event. These are events specified by a device’s service class.\n\n### Get\nA get event. These are triggered by get requests for a device using the `refresh` flag.\n\n### Set\nA set event. These are triggered by an explicit set command by a user.","excerpt":"Get history of device actions","slug":"history-devices","type":"endpoint","title":"History"}

getHistory

Get history of device actions

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string
[device](doc:devices) id

Query Params

continuationToken:
string
A system-generated token representing the page start
endDate:
datetime
Constrain query to events before the specified ISO 8601 date time
index:
integer
Constrain query to services on a specified index
member:
string
Constrain query to a specified service member
pageSize:
integer50
Number of results per page
service:
string
Constrain query to services of a specified name
startDate:
datetime
Constrain query to events after the specified ISO 8601 date time
type:
string
Constrain returned device action to the specified action type (_changed_, _event_, _get_, and _set_)

Examples


Result Format


Documentation

History is used to get a history of device actions. These actions may be filtered based on the supplied parameters. [block:api-header] { "type": "basic", "title": "Parameter notes" } [/block] ## continuation token Continuation tokens are used in order to get the next page when a query has paginated data. The user is not expected to arbitrarily fill in the token; rather, an endpoint with the token prefilled in is provided on the query results under the `next` property. ## Date/Time filter The results may be filtered to be within a specified date/time range using the `startDate` and/or `endDate` parameter. The date/times are formatted in the ISO 8601 date format. Note: the date/times are filtered based on when the server logged the event which _may_ be a after the time that the event happened. ## Type The type of the event. The types are: ### Changed A property changed event. Property changed events are not limited to explicit set commands issued by a user. ### Event A service event. These are events specified by a device’s service class. ### Get A get event. These are triggered by get requests for a device using the `refresh` flag. ### Set A set event. These are triggered by an explicit set command by a user.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}