Hi there,
is there a way to delete the entire state or time slice of it (one or many attributes) for a device via API or Node function?
This is to prevent dirty data coming into the system as a result of a parsing issue or a source issue.
Cheers.
You can delete device data for a given device on the device’s detail page, in the “Other Actions” dropdown. The default settings are to delete all attribute data associated with the device, but you can click the “Make changes” button to narrow the deletion request to a time range and specific attributes.
From the device list, you may also do the same but for a set of devices in bulk.
Behind the scenes, both requests use the Devices: Remove Data API endpoint. If you wish to do the deletion programatically, you can use the same endpoint.
I totally missed that function thanks!
Hi Dylan,
I am wondering if the selective attribute option that is available via the UI is also available through the API…?
Given your answer, I suspect it is, but it is not covered by the documentation (as far as I can see) as to how to specify a subset of attributes.
Best,
Tim.
Hey @Tim_N,
Using this Devices: Remove Data API Endpoint you can pass a list of attributes to remove via the body of the request. An example of the body of that request is
{
"query": {
"id": "deviceID"
},
"start": 1,
"end": 0,
"attributes": [
"deleteMyData",
"mineToo"
]
}
Here is a link to the body schema for all the options you can send to that API endpoint.
Hope this helps! Let me know if you have any other questions.
Perfect!
Thankyou Erin.