Delete Resources

If a Device has a resource that can be deleted, then the IMPACT may send a delete command JSON using the POST method to /devices.

The resources token contains an array of URIs to perform execute on and the endPointClientNames token contains an array of Device identifiers on which the operation is executed. The Adaptation Layer must respond with http status 200 OK and asynchronously POST command response to /m2m/device.

The expected response for this delete request is given in the below table. If any one of the Devices fails to perform the delete operation, then the entire operation is considered a failure and appropriate status codes from the enumeration can be sent. If ‘correlatorId’ is found in the ‘execute’ command then the same token along with its value must be sent back in the response.

Table 1. Delete resources API format
Parameters Description
URL http://<adapter_hostname>:<port>/devices
Method POST
Content-Type application/json
Parameters

The parameters are:

  • correlatorId - Specifies a unique identification generated by IMPACT to identify the command.
  • endPointClientNames - Specifies an array of Device serial numbers whose resource values are to be deleted.
  • resources - Specifies an array of Device resources on which Delete operation is to be performed.
Sample Call
{
	“correlatorId”:”the correlator value”
           "delete":[
                      {
                         "resources":"device/0/battery",
                         "endPointClientNames":["TTo1AZliuT"]
                      },
                      {
                          "resources":"device/0/firmware",
                          "endPointClientNames":["TTo1AZliuT","asdfgh"]
                       }
                ]
}

Response Body:

{
	{{
	“correlatorId”:”the correlator value”
                "deleteResponse":{
		“requestStatus”:0,
		“responseCode”:0,
}
}
Success Code
Response Code: 200
Error Code
400 : Bad Request
401 : Unauthorized 
403 : Forbidden 
404 : Not Found