Unable to install smartApps using Smarthings Rest Api

I have been following the rest API spec of Smarthings for some automation purpose.
I am referring the following link

The steps I have followed is

  1. Create a device profile
  2. Create an app
  3. Update oauth for app

Now I have to install a device , the install device API requires a installedAppId .
I am not able to get installedAppId from any API. I can see the app in a list of apps available but not in the list of apps installed.
I want to perform the operation using code as this is for automation purpose.
Please suggest