Invoke DELETE Method on a Device
/iot/api/v2/apps/{app-id}/devices/{device-id}/resources/{subResources}
Does the specified resource invocation by forwarding the request to the specified endpoint and providing a response sent by it and received back by the server. The handler of the resource optionally receives request's body that may contain data of an artitrary type. Invocation may take a significant time to complete depending on connectivity of an endpoint; the messages that carry request and response data may stay pending on both sides waiting for a chance to be delivered for minutes, hours, or days.
There are two invocation modes supported by this interface: synchronous and asynchronous. With synchronous request the server does not reply until a response gets received from the endpoint or a timeout expires. If the request is done in the asynchronous mode then the server returns immediately providing an assigned request ID that can be used for polling via another API to check if the response from the endpoint is available. The request mode can be specified with query parameters "iot.sync" or "iot.async". By default if none of the parameters is set then the request is asynchronous. These parameters must not be set both. The asynchronous mode is a preferrable way of doing invocation as it does not consume as much server resources as compared with the sycnhronous mode. Optionally, a timeout value in milliseconds may be provided with the "iot.timeout" query parameter.
The DELETE method must be supported by the endpoint resource to expect the request is forwarded to the endpoint. If not, the server rejects the request and replies with an error.
Request
-
app-id: string
ID of application to be retrieved from Cloud Service
-
device-id: string
Unique identifier of the device
-
subResources: string
Device resource
Response
200 Response
object
-
complete:
boolean
Property description was not set
-
endpointId:
string
Property description was not set
-
requestId:
string
Property description was not set
-
requestMethod:
string
Property description was not set
-
requestReceivedTime:
string
Property description was not set
-
requestUrl:
string
Property description was not set
-
responseEventTime:
integer
Property description was not set
-
responseJson:
string
Property description was not set
-
responseReceivedTime:
string
Property description was not set
-
responseStatusCode:
string
One of [HTTP 200: OK, HTTP 201: Created, HTTP 202: Accepted, HTTP 203: Non Authoritative Information, HTTP 204: No Content, HTTP 400: Bad Request, HTTP 401: Unauthorized, HTTP 402: Payment Required, HTTP 403: Forbidden, HTTP 404: Not Found, HTTP 405: Method Not Allowed, HTTP 406: Not Acceptable, HTTP 408: Request Timeout, HTTP 409: Conflict, HTTP 500: Internal Server Error, HTTP 502: Bad Gateway, HTTP 503: Service Unavailable].
-
status:
string
One of [RECEIVED, DISPATCHED, COMPLETED, EXPIRED, FAILED, UNKNOWN].
400 Response
401 Response
403 Response
404 Response
405 Response
Examples
curl -X DELETE
-u <username>:<password>
http://iotserver/iot/api/v2/apps/{app-id}/devices/{device-id}/resources/{subResources}
Example of Response Body
The following example shows the content of the response body in JSON format
{
"requestTime":"2016-07-22T10:44:57.746Z",
"responseEventTime":"2016-07-22T10:44:57.746Z",
"responseStatusCode":"HTTP 200: OK",
"method":"Request method",
"responseTime":"Time when the response is received by server",
"response":"Original response message payload JSON document",
"endpointId":"37793cb06711-643d",
"links":[
{
"rel":"self",
"href":"http://iotserver/iot/api/version/resource/path"
},
{
"rel":"canonical",
"href":"http://iotserver/iot/api/version/resource/path"
}
],
"id":"33428477a5c-59c2",
"complete":false,
"url":"http://iotserver/iot/api/version/resource/path",
"status":"RECEIVED"
}
Complete cURL Example
The following example shows compete cURL comand that can be used to perform described operation
curl -X DELETE
-u <username>:<password>
http://iotserver/iot/api/v2/apps/325173f26e4b-6b4b/devices/325173f26e4b-6b4b/resources/{subResources}
Note that in the request, http://iotserver will be replaced by the name and port of your assigned IoT Cloud Service instance. The format of the Cloud Service instance is https:// myinstance-myidentitydomain.iot.us.oraclecloud.com and the default port is 443.