Home/Support/Support Forum/Delete Task by URL request
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Delete Task by URL request

0 votes
Hello everybody,

because schedules will be deleted automatically after some time, we like to delete some tasks by the device id. Get information by target id works fine:

###
GET https://my.devicecloud.com/ws/Task/.json?condition=tskTargets='00001337-00000000-00000000-00XXXX42'
-- response --
200 OK
###

Now we like to delete the device:

###
DELETE https://my.devicecloud.com/ws/Task/?condition=tskTargets='00001337-00000000-00000000-00XXXX42'
-- response --
500 Internal Server Error
###

According to your documentation ( http://www.digi.com/resources/documentation/digidocs/90002008/reference/r_ws_task.htm ) delete isn't possible (unfortunately, this seems to be outdated). But if you call

###
DELETE https://my.devicecloud.com/ws/Task/XXXYYZZ
-- response --
200 OK
<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<message>0 items deleted</message>
</result>
###

As you see, no items seems to be deleted. But if you are looking for the device, it has been deleted successfully (so the amount of deleted entries is buggy?):

###
GET https://my.devicecloud.com/ws/Task/?condition=tskTargets='00001337-00000000-00000000-00XXXX42'
-- response --
200 OK
<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
<resultTotalRows>0</resultTotalRows>
<requestedStartRow>0</requestedStartRow>
<resultSize>0</resultSize>
<requestedSize>1000</requestedSize>
<remainingSize>0</remainingSize>
</result>
###

So how to delete a task properly? We prefer to delete a task directly by the device id. So we don't have to know the task id or the schedule id.

Best regards,
Yannick
asked Aug 3, 2016 in Web Services by YaLo New to the Community (0 points)
edited Aug 3, 2016 by YaLo

Please log in or register to answer this question.

...