Retrieve Resource Request Status
get
/iot/api/v2/requests/{requestId}
This interface should be used for polling the server to check the status of a previously posted asynchronous invocation request.
Once such a request reaches the server it replies without a delay reporting a new request ID. The request status can be:
Once such a request reaches the server it replies without a delay reporting a new request ID. The request status can be:
- RECEIVED - received by the server, not sent to the endpoint yet
- DISPATCHED - sent to the endpoint, no response received yet
- COMPLETED - response received, the output JSON contains the response message received from the ednpoint
- FAILED - an error occured, the invocation request was not handled
Request
Path Parameters
-
requestId: string
Entity description is undefined
Response
Supported Media Types
- application/json
200 Response
Successfully processed
Root Schema : ResourceRequestStatusImpl_receive
Type:
Show Source
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
Bad Request. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
401 Response
Unauthorized. The request requires user authentication.
404 Response
Not Found. The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
Examples
The following example shows how to get the status of a request with request_Id 330b5e4c447f-588d
, by submitting a GET request on the REST resource using cURL. Note that in both the request and response, iotserver
will be replaced by the name and port of your assigned IoT cloud server. The format of the Cloud Service instance is myinstance-myidentitydomain.iot.us.oraclecloud.com
and the default port is 443. For more information about cURL, see Use cURL.
curl -X GET -k -u username@example.com:welcome1 -H "Accept: application/json" 'https://iotserver/iot/api/v2/requests/330b5e4c447f-588d'
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK Content-Type: application/json
Example of Response Body
The following example shows the contents of the response body in JSON format.
{ "responseEventTime":"2016-07-22T10:44:57.746Z", "requestTime":"2016-07-22T10:44:57.746Z", "responseStatusCode":"HTTP 200: OK", "method":"Request method", "response":"Original response message payload JSON document", "responseTime":"Time when the response is received by server", "endpointId":"16a7421e2f4b-5433", "links":[ { "rel":"self", "href":"http://iotserver/iot/api/version/resource/path" }, { "rel":"canonical", "href":"http://iotserver/iot/api/version/resource/path" } ], "id":"330b5e4c447f-588d", "complete":false, "url":"http://iotserver/iot/api/version/resource/path", "status":"RECEIVED" }