Retrieve the Latest Value of a Specific Attribute
get
/iot/api/v2/apps/{app-id}/devices/{device-id}/deviceModels/{devicemodel-id}/attributes/{attribute-name}
Retrieve a simple JSON document, which contains last known value of the attribute.Outgoing JSON document format is {"attribute Name":<value>} such as { "temp": 12.3 }
Request
Path Parameters
-
app-id: string
Unique identifier of the application
-
attribute-name: string
Attribute name
-
device-id: string
Unique identifier of the device
-
devicemodel-id: string
URN of the device model
Response
Supported Media Types
- application/json
- application/vnd.oracle.resource+json;type=singular
200 Response
Successfully processed.
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.
403 Response
Forbidden. The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated.
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.
405 Response
Method Not Allowed. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
406 Response
Request Not Acceptable. The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.
Examples
curl -X GET
-u <username>:<password>
http://iotserver/iot/api/v2/apps/{app-id}/devices/{device-id}/deviceModels/{devicemodel-id}/attributes/{attribute-name}
Complete cURL Example
The following example shows compete cURL comand that can be used to perform described operation
curl -X GET
-u <username>:<password>
http://iotserver/iot/api/v2/apps/57f61d1e7405-78c9/devices/57f61d1e7405-78c9/deviceModels/57f61d1e7405-78c9/attributes/{attribute-name}
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.