Well, this is not usable if you have authentication enabled. Or better to say it is, but you need to add the authentication header with valid token, which is changing quite often.
var headers = new java.util.HashMap();
headers.put("Authorization", "Bearer " + token);
sendHttpPutRequest("http://IPADRESS:8080/rest/things/THING:THING/enable", "text/plain", 'false', headers, 5000);
Any idea how to get a valid token in a dsl script to not be forced to update it daily?
Nope, that’s a very good point. I was using the token captured from headers used by browser, but as said before, it changes every 24 hours or so. Thanks for the link!