//Retrieve all of the folders from root Site
function getFolders() {
var executor;
// Initialize the RequestExecutor with the app web URL.
executor = new SP.RequestExecutor(appweburl);
executor.executeAsync({
url: appweburl + "/_api/SP.AppContextSite(@target)/web/getfolderbyserverrelativeurl('/GowthamLibrary')/folders?@target='" + hostweburl + "'",
method: "GET",
headers: {
"Accept": "application/json; odata=verbose"
}, success: FoldersSuccessHandler,
error: FoldersErrorHandler
});
}
im creating app to retrive the folders from Library but im getting error.i think uRL formation is wrong.anyone can help me to fix this?

Posted Mar 23, 2015, 11:25 AM
This link may help you, visit this link
http://www.c-sharpcorner.com/UploadFile/91b369/how-to-get-all-folders-from-root-site-using-rest/
kindly mark as answer, if it helps your