Retrieve the Latest Value of Attributes
get
/iot/api/v2/apps/{app-id}/devices/{device-id}/deviceModels/{devicemodel-id}/attributes
Retrieve a simple JSON document, which contains last known values collected from the device or device application. Outgoing JSON document format is {"attribute Name 1":<value>, "attribute Name 2":<value> ...} such as { "temp": 56.23, "minTemp": 0.0 }
Request
Path Parameters
-
app-id: string
Unique identifier of the application
-
device-id: string
Unique identifier of the device
-
devicemodel-id: string
URN of the device model
Query Parameters
-
since(optional): integer
Optional 'since' query parameter is used to indicate that only attributes that were modified since (inclusive) the specified timestamp is returned.
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
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/21bf535f13e5-42f6/devices/21bf535f13e5-42f6/deviceModels/21bf535f13e5-42f6/attributes
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.