How to get list of devices that paired into SmartThing Hub from coding prospective

Hi Guys,

How to get the list of devices that paired into the hub from coding prospective?
I mean by using Groovy, is there any API for this one?

I would recommend taking a read through the docs.
http://docs.smartthings.com/en/latest/index.html

If you haven’t already, start with the introductory docs to understand some of the concepts specific to SmartThings and then the section on selecting devices is:
http://docs.smartthings.com/en/latest/smartapp-developers-guide/devices.html

Note that a SmartApp typically selects devices based on the capability. For example, you might ask for all capability.switch devices to get all devices that can switch on/off.

Yeah, I read that.

I mean is there any API that able to list all the devices that paired on the SmartThing’s Hub

like getHubDevices()
and the return would be
{SmartSense, Zwave-Contact Sensor, Philip Hue}

Got it, all fall under ${settings}

As you found, all devices that the user selected during installation of the SmartApp are stored in settings (along with all other user inputs).

You cannot get info or a list of a devices that the user did not authorize/select in a SmartApp. This is by design; SmartApps only have access to those devices specifically authorized by the end user.