Retrieving Partial Resources

Several Oracle Internet-of-Things (IoT) Cloud Service REST API resources support the partial retrieval of a resource. You may want to retrieve only some of the available fields when the details on a resource is very large.

This is not typical unless the additional attributes are costly to fetch or very long, and there is concern for bandwidth constraints. The REST API documentation indicates which resources support partial retrieval and which fields are supported.

There is currently one query parameter related to partial retrieval: fields . The fields query parameter is used to list exactly which fields are to be returned. Only these fields listed will be returned (in addition to the selfLink and canonicalLink attributes). Any fields listed that are not actually on the data model are ignored.

For example, if you send the following request:
GET http://MySmartHome-MyCompany.iot.us1.oraclecloud.com/iot/api/v1/endpoints?fields=id,description
you will get a response similar to the following:
{
    "items":[
        {
           "id": 0-AE,
           "description": "Office Lock"
        },
        {
           "id": 0-MQ,
           "description": "Living Room Blinds" 
        },
        {
	    			"id": 0-NI,
            "description": "Thermostat"
        }
     ],
     "links":[
        { "rel":"canonical",
 	  "href": http://iotserver/iot/api/v1/endpoints" },
        { "rel":"self",
	  "href":"http://iotserver/iot/api/endpoints?fields=id,description" }
     ]
}