After long research and lot of help I am able to read from a list in sharepoint. I have been using Sharepoint online apps and giving permission on them and then use the apps Client id , secret key to log into sharepoint and read list. Now what I want to do is create a subsite. However I get Access denied error. I have tried to give Fullcontrol access to the app I created (shown below), but I still get Access denied error. Any pointers would be great.
<AppPermissionRequest Scope="https://XXXXXXX.sharepoint.com/sites/HomeTest3" Right="FullControl" />